jQuery in Action, 3rd edition
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Question from vodoo exam 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 "Question from vodoo exam" Watch "Question from vodoo exam" New topic

Question from vodoo exam

Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Posts: 442

I am unable to understand above code.It compiles fine . But semicolon on line 1 is not appropriate syntax ,right?

"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
O Joseph
Ranch Hand

Joined: Jun 27, 2003
Posts: 75
i got a lot to say 'bout ur code but first, did u make this code urzelf?

Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
It does look unusual, but JLS is full of such syntax examples:JLS 14.3
This is not the dedicated section, but it has those semicolons.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Really that is so normal like this
class Ques01 { ; ;};
but stranger
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
Hi Veena,
I do not know that significance of ';' at line1. However, code compile and runs fine with / without the ';'.
When an inner class inherits x and y from a super class and also have access to x and y from enclosing class, the inherited x and y will take precedence. Therefore, output is 78 and 20.
Hope this makes sense.
Alton Hernandez
Ranch Hand

Joined: May 30, 2003
Posts: 443
A semicolon(;) is by itself a statement indicating the end of the statement.

[ October 02, 2003: Message edited by: Alton Hernandez ]
I agree. Here's the link: http://aspose.com/file-tools
subject: Question from vodoo exam
It's not a secret anymore!