This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes TrynCatch 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 "TrynCatch" Watch "TrynCatch" New topic
Author

TrynCatch

Roberto Diaz
Ranch Hand

Joined: Mar 08, 2002
Posts: 40
I have following code which works just fine.

But if I add the print statement in class B it
fails to compile.
Can anyone expalin whatz going on behind the scenes??
TIA.
[ Jess added UBB [code] tags to preserve whitespace, check 'em out! ]
[ January 14, 2003: Message edited by: Jessica Sant ]
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

its actually pretty simple
the System.out.println statement needs to be inside a method or a constructor:


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
 
Have you checked out Aspose?
 
subject: TrynCatch
 
It's not a secret anymore!