This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes static nested class 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 » Java » Beginning Java
Bookmark "static nested class" Watch "static nested class" New topic
Author

static nested class

Ajay Kumar Rana
Greenhorn

Joined: Feb 27, 2008
Posts: 13
Can we instantiate a nested static inner class with the help of an instance of outer class. For example

public class Exercise1 {
public static void main(String[] args){
MyOuter1 m = new MyOuter1();
MyOuter1.MyInner mi = m.new MyInner(); // is it correct???
}
}
class MyOuter1{
public static class MyInner{public static void foo(){}}
}

Why or why not?
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
DoYourOwnHomework.

Don't just post your homework here. The bartenders won't answer such questions, and hopefully no-one else will, either.

Show some effort, propose an answer, ask for clarification of specific points etc. Then we'll happily help.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: static nested class
 
Similar Threads
Static Local Classes?
static inner class question
outer class name obligatory
Inner class
inner class reference