YES , Constructor can also throw exceptions like normal method does.
public class ConstructorTest { public ConstructorTest() throws InterruptedException { System.out.println("Before Sleep"); Thread.sleep(1000); System.out.println("After Sleep"); }
No comments:
Post a Comment