• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The try block

 
Vlada Den
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey!!

Is it possible to use try on a single statement?

Thanks,

Vlada
 
Junilu Lacar
Bartender
Posts: 7486
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vlada Den:
Hey!!


Right back atcha!

Sure, it's possible.
 
Vlada Den
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you , Junilu.

I've just tried it out and it worked. But in my texbook "Java 2: The Complete Reference" it says, that you can't use try on a single statement.

Vlada
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you have misread something.
The book must have told you, that try cant be used alone without a catch or finally
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic