GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Typical class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Typical class " Watch "Typical class " New topic
Author

Typical class

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
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


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643

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

Joined: Feb 02, 2006
Posts: 2023
Object initialization in Java
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Typical class