Two Laptop Bag
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Static local inner class 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 "Static local inner class" Watch "Static local inner class" New topic

Static local inner class

Shailendra Bade

Joined: Jul 04, 2000
Posts: 22
Can I have a static inner class inside a method(local static
inner class).

Shailendra Bade
Mumbai, India
Mail to:

Shailendra Bade<BR>Mumbai, India<BR>Mail to:
Junaid Bhatra
Ranch Hand

Joined: Jun 27, 2000
Posts: 213
No. Within a method, the only modifier you can use is final. You cannot use private, protected, public, static, etc inside a method. Hence you cannot declare a local static inner class.
I agree. Here's the link:
subject: Static local inner class
It's not a secret anymore!