Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes How to call InnerClass method...Help..Urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to call InnerClass method...Help..Urgent" Watch "How to call InnerClass method...Help..Urgent" New topic
Author

How to call InnerClass method...Help..Urgent

sam patel
Ranch Hand

Joined: Jun 13, 2002
Posts: 103
Hi,
How can i call a setName() method of the Inner class in below code.
Any help will be greatly appreciated.
Thanks.
public class EnclosingClass{
public class InnerClass{
private String name;
public String getName(){
return name;
}

public void setName(String name){
this.name = name;
}
}
}
sam patel
Ranch Hand

Joined: Jun 13, 2002
Posts: 103
I figured it out!
EnclosingClass ec = new EnclosingClass();
EnclosingClass.InnerClass ei = ec.new InnerClass();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call InnerClass method...Help..Urgent
 
Similar Threads
Certification4Career SCJP Mock Exam Errors??
Please tell me output flow for this program
Inner Class Object
\what is "this" mean ?