What OP is produced by the following code Could you write yo

What O/P is produced by the following code? Could you write your own catch method pair with a try block? Study the following codes with try and catch structure, any error in the code? If there are no error in the code, the citizen (user) entering 12000 annual income, what will be the O/P

Solution

49)waittime is greater than 30,so it throws exception so it will not excute other statements in code it directly goed ot the catch block,after catch block no statements will be executed,so the output will be

try block entered.

Exception:time limit exceeded

50) yes we can create a catch method for a try block on our own.

error found in the code,in catch block exception name is directly used ,it should be like exception_name.getMessage()

if yout enter incAmt as 12000 then in try block condition is tru so it throws a exception with the message qualified for ssi suppliment,then this exception is handled by the catch block and in that it prints

citizenName:eneredcitixenName

Qualified for SSI supplement

 What O/P is produced by the following code? Could you write your own catch method pair with a try block? Study the following codes with try and catch structure

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site