• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question from vodoo exam

 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am unable to understand above code.It compiles fine . But semicolon on line 1 is not appropriate syntax ,right?
 
O Joseph
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got a lot to say 'bout ur code but first, did u make this code urzelf?
 
Vad Fogel
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Really that is so normal like this
class Ques01 { ; ;};
but stranger
 
Barkat Mardhani
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Barkat
 
Alton Hernandez
Ranch Hand
Posts: 443
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A semicolon(;) is by itself a statement indicating the end of the statement.

~
[ October 02, 2003: Message edited by: Alton Hernandez ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic