This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ambiguity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "ambiguity" Watch "ambiguity" New topic
Author

ambiguity

Francis Palattao
Ranch Hand

Joined: Sep 22, 2004
Posts: 91
I did 2 mocks one of them from the whizlabs.

I get confused sometime when it asks me what the output is when it seems ambiguious.

I think the question was like nested if statements.

So as I was tracing along I realized there is no main program or even a class. Do I assume that this is already done and they omitted it out or should I say cannot compile because there is no main method.


SCJP 1.4 <br />SCWCD 1.4 (preparing)<br />SCBCD 1.3 (coming soon)
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
You can certainly compile a class without a main method, so don't choose that.
If you do not understand a mock question, then compile it yourself. If it compiles, then run it, writing your own main method to create instances of the class if necessary. You can also use a free learning IDE called BlueJ which allows you to create instances without main method if you want.

A secret: I use BlueJ all the time when helping people on this forum: try, see, learn.
[ December 15, 2004: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Francis Palattao
Ranch Hand

Joined: Sep 22, 2004
Posts: 91
but the question itself did not have a class. I'm aware that a class can contain without a main but in the question it had only the declaration of variables and nested if statemetns.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Then put them in a static method in a class.
[ December 15, 2004: Message edited by: Barry Gaunt ]
Francis Palattao
Ranch Hand

Joined: Sep 22, 2004
Posts: 91
I'm still confused Barry.

If the question on the exam seemed like it would compile and run if placed in a main method should I assume this. Or do I say it wont compile, because there is no class declaration.
 
Don't get me started about those stupid light bulbs.
 
subject: ambiguity
 
Similar Threads
compiler error
NoClassDefFound.
Clarification on Var args
toString()?
Simple problem