File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Hi, All SCJP Candidate help me 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 "Hi, All SCJP Candidate help me" Watch "Hi, All SCJP Candidate help me" New topic

Hi, All SCJP Candidate help me

Guddu Bhai

Joined: May 11, 2006
Posts: 1
class Emp

is this valid file is this class compile.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Guddu Bhai:
class Emp

is this valid file is this class compile.


Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Hi Guddu.
this is the Servlet forum. Next time, please post to the SCJP forum
Thank you.

[My Blog]
All roads lead to JavaRanch
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Moving to the SCJP Cert forum.
Shaliey Gowtham
Ranch Hand

Joined: Mar 20, 2006
Posts: 104
Even a empty file is a valid java file and will compile.
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023

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.

{ ClassBodyDeclarationsopt }

ClassBodyDeclarations is "optional".
Marcus Green
arch rival

Joined: Sep 14, 1999
Posts: 2813
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.

SCWCD: Online Course, 50,000+ words and 200+ questions
I agree. Here's the link:
subject: Hi, All SCJP Candidate help me
It's not a secret anymore!