Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

try without catch

Can we have
try block without catch block


If we write system.exit then does  finally executes. I am not clear on this.

Please advise. Any ideas, resources, sample code highly appreciated. thanks in

advance
SOLUTION
Avatar of bigbigpig
bigbigpig

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

>>System.exit() exits immediately. You should write a try-finally block with a System.exit() call in the try block and a System.out.println() call in the finally block to see.

if i have try block with System.exit followed by finally with System.out.println()  

When the program exit it will go to finally block right. Please advise
I answered that question already. You should write the five lines of code that will allow you to verify my answer.
ASKER CERTIFIED SOLUTION
Avatar of Valeri
Valeri
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@gudii9
You have quite some open questions...
Don't forget to return to your questions and close them when they're done.