Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Typical class

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the question from voodoo simulator

i saw this question for the first time

oh god


can any one please explain me about this class clearly (i mean step by step)...
in this program try catch block is inside { } braces

and at the end of the class there is semicolon after the brace

why??

somebody clear my doubt
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Above code is initialization block.
initialization blocks run when new instance is created.
In your code there is not any instance of Test so initialization block
will never executed.
create new instance of Test in your code and initialization block will be executed.
Semicolon at the end of class is optional.
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Object initialization in Java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic