This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Local class is a inner class?  RSS feed

 
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!