This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Local class is a inner class?

 
Badri Sarma
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Srik Buddha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
U r right, Rory.
Local class cannot be declared static. My fault.
 
Badri Sarma
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic