aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner classes" Watch "Inner classes" New topic
Author

Inner classes

Ferwed Kondos
Greenhorn

Joined: Sep 27, 2007
Posts: 6
Inner classes cannot have static members of any kind? true or false
John Stone
Ranch Hand

Joined: May 04, 2007
Posts: 332
true - if we consider declaration only
false - if we consider also inheritance (static member can be inherited)
John Kristin
Greenhorn

Joined: Sep 19, 2007
Posts: 13
But We can have static members in "Static Inner class" if enclosing class does not have any static/final member

public class Tests {
public static void main(String args[])
{
}
static class inner
{
static int s=10;
public static void rt()
{

}
}
}


[ September 30, 2007: Message edited by: John Kristin ]
[ September 30, 2007: Message edited by: John Kristin ]
Ankith suresh
Ranch Hand

Joined: Jun 07, 2007
Posts: 42
Hi john
But We can have static members in "Static Inner class"
"if enclosing class does not have any static/final member" ???

What does
"if enclosing class does not have any static/final member" ???
meant???
John Stone
Ranch Hand

Joined: May 04, 2007
Posts: 332
from Sun tutorial:


So, when I talked about inner classes, I always meant non-static nested-classes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inner classes
 
Similar Threads
Why final keyword is accepted with private?
Re:inner classes
Native Method
What is a class file with $ symbol in the name
Most Difficult Part?