Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner Class

 
Siva kandasamy
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic