wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Local class is a inner class? 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 "Local class is a inner class?" Watch "Local class is a inner class?" New topic
Author

Local class is a inner class?

Badri Sarma
Ranch Hand

Joined: Apr 01, 2003
Posts: 72
Hi
i know that local class is a inner class, what access modifiers are applied to local class.
Can we provide public,private,protected or static
Badri


Thanks<br />Badri
Srik Buddha
Greenhorn

Joined: May 03, 2003
Posts: 3
From what I understand, I think the local classes are those classes that are declared inside a method. Access modifiers are not allowed, though static is allowed.
Srik
Rory French
Ranch Hand

Joined: Apr 03, 2003
Posts: 97
A Local inner class can be declared iether abstract or final, and it may be declared strictfp. It may NOT be declared static, and may NOT be declared with any access modifiers (i.e. private, protected, public).
[ May 03, 2003: Message edited by: Rory French ]
Srik Buddha
Greenhorn

Joined: May 03, 2003
Posts: 3
U r right, Rory.
Local class cannot be declared static. My fault.
Badri Sarma
Ranch Hand

Joined: Apr 01, 2003
Posts: 72
Thanks a lot
A local class is a inner class which is declared inside the method.
It cannot have any access modifiers like public, private, protected, and static.
where in it can have abstract, final and strictfp
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Local class is a inner class?
 
Similar Threads
Method Local inner class
Inner Classes
regd local inner class (method level)
Inner class
method-local inner class object cannot use the local variables