permaculture playing cards*
The moose likes Beginning Java and the fly likes Inner 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 "Inner Class" Watch "Inner Class" New topic
Author

Inner Class

Siva kandasamy
Ranch Hand

Joined: Dec 31, 2002
Posts: 139
Hi there,
I have couple of questions.
1. Why do I need interface "Contents.java" to compile "Parcel6.java"



2. How the both definitions are same.

return new Contents() {
private int i = 11;
public int value() { return i; }
};



class MyContents implements Contents {
private int i = 11;
public int value() { return i; }
}
return new MyContents();

[ January 01, 2004: Message edited by: Sivanantham kandan ]
[ January 02, 2004: Message edited by: Sivanantham kandan ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inner Class
 
Similar Threads
anonymous inner class and Constructor
Inner class
Inner class access specifier
Unable to assign value to integer x
unable to define static variable inside method