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 Inner Local Classes 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 "Inner Local Classes" Watch "Inner Local Classes" New topic

Inner Local Classes

Saira Dhanani

Joined: Sep 07, 2006
Posts: 3
Need some help with the following program
When trying to print in the Non static local class the following error is encountered
C:\java>javac <identifier> expected

Thanks for helping
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
This is a simple syntax error. You are putting an executable statement "System.out.println("xyz");" in the wrong place. It needs to be in a method.

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

Joined: Sep 07, 2006
Posts: 3
Thank You ...
I agree. Here's the link:
subject: Inner Local Classes
Similar Threads
static final variable initialization inside instance init block
Please rectify this code on anonymous classes
when static why does answer change?
I have some questions regarding the access in enclosing context of static and non-sta
static method local classes