Suppose the exception class TestException is defined as follows: public class TestException extends Exception { public TestException() { super("Test Exception thrown!"); System.out.println( "Test...



Suppose the exception class TestException is defined as follows:


public class TestException extends Exception


{



public TestException()



{



super("Test Exception thrown!");



System.out.println(



"Test exception thrown!!");



}



public TestException(String message)



{



super(message);



System.out.println(



"Test exception thrown with an argument!");



}



public void testMethod()



{



System.out.println("Message is " + getMessage());



}


}


What output would be produced by the following code (which is just an


exercise and not likely to occur in a program)?


TestException exceptionObject = new TestException();


System.out.println(exceptionObject.getMessage());


exceptionObject.testMethod();


The class TestException is on the website that comes with this text.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here