wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes nested class Danchisholm ques. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "nested class Danchisholm ques." Watch "nested class Danchisholm ques." New topic
Author

nested class Danchisholm ques.

cs singh
Ranch Hand

Joined: Dec 28, 2005
Posts: 36


Answer is a, b, c, e.

i cant understand the answer.
Thanks,
Chani.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Class Z is local to the method m1, and local classes can access local variables only if those variables are final. (See this thread for more details.)

In this case, local variables s5 and s3 are both final, although local variables s6 and s4 are not final.

s1 and s2 are instance variables of the enclosing class (not local to m1), so both of these can be accessed.

So the answer is s1, s2, s3, and s5.
[ February 09, 2006: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: nested class Danchisholm ques.
 
Similar Threads
static inner classes
nested class Danchisholm ques.
Strings
Dan's exam nested class
Local class program error