Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Requirement of a class definition

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am studying for SCJP. I got a study pack. In there they say that there are three top level elements, which are namely Package decleration, importing classes and class definition. They further say that all these 3 is not needed but if they are there they should be in the above metioned order.
The question I am having is, what do they mean by class definition, if it is just 'class AnyName', how it is possible not to have this in a java program.
Please do advice me on this.
Thank you very much....
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I guess the the class declaration isn't syntactically enforced (though I am not sure about it). A java file without it would be rather useless, though...
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer. But I got the answer, what there are meaning here is about the interfaces etc which doesn't have a class decleration.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic