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

Sun certification 310-035

 
Hari priya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all -
I am taking the java certification exam by sun (310-035) in a couple of days. However, I am having a question with regards to the presentation of code in the exam.
If the code sarts from line 1, and does not start with a class declaration then should I consider it as the beginning of the code (in which case the compilation fails)?
Example:
1. int a=0;
2. public void foo(){
3. System.out.println("Foo");
4. }
as opposed to
1. public class A{
2. int a=0;
3. public void foo(){
4. System.out.println("Foo");
5. }
6.}
Please clarify me.
Regards.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch forjava!
First, and while glad to see your name is so dedicated to the language, it violates our Naming Policy. You need to have both a first and last name, and they must be realistic first and last names. We prefer people to use their own names, but if you aren't comfortable with this, make something up that looks real.
Second, since we have forums specifically for the SCJP exam, I'm moving this post there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic