Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi, All SCJP Candidate help me

 
Guddu Bhai
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class Emp
{

}
is this valid file is this class compile.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Guddu Bhai:
class Emp
{

}
is this valid file is this class compile.


Yes.

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guddu.
this is the Servlet forum. Next time, please post to the SCJP forum
Thank you.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the SCJP Cert forum.
 
Shaliey Gowtham
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even a empty file is a valid java file and will compile.
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

8.1.6 Class Body and Member Declarations
A class body may contain declarations of members of the class, that is, fields (�8.3), classes (�8.5), interfaces (�8.5) and methods (�8.4). A class body may also contain instance initializers (�8.6), static initializers (�8.7), and declarations of constructors (�8.8) for the class.


ClassBody:
{ ClassBodyDeclarationsopt }



ClassBodyDeclarations is "optional".
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not try using the javac compiler to find out if it will compile? Otherwise you will spend your time guessing or waiting for replies for other people when you could be learning.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic