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 Not compiling 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 "Not compiling" Watch "Not compiling" New topic
Author

Not compiling

shabbir ali
Greenhorn

Joined: Sep 02, 2006
Posts: 16
HI can anybody tell me y this code is not compiling while it is given in cathy seirra and bates book "scjp study guide"...(page no 25)



Thank you......


[HENRY: Added code tags, and formatted code]
[ September 02, 2006: Message edited by: Henry Wong ]
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18538
    
  40

The code looks fine to me. Could you provide us with the error messages that you are getting when you compile it.

Of course, since there isn't a main() method, you can't actually run the code... but it should compile.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
What compiler errors are you getting? Compiles and runs (when an instance of Moo is created and the method useAZoo is called). Like Henry says, there is nothing obviously wrong.
[ September 02, 2006: 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.
 
wood burning stoves
 
subject: Not compiling
 
Similar Threads
Method is static, yet I get compiler error saying it cannot be accessed from static context
NoSuchMethod:main error
Access Modifiers
Inheritance