File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TrynCatch