my dog learned polymorphism
The moose likes Beginning Java and the fly likes Requirement of a class definition Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Requirement of a class definition" Watch "Requirement of a class definition" New topic
Author

Requirement of a class definition

Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
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....


SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Requirement of a class definition
 
Similar Threads
Multiple Tiles Definition files OR passing parameters to tiles.xml at runtime
Array clone
diff b/w classnotfoundexception and noclassdeffounderror
Class definition
Mapping