Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

interfaces

 
pt kris
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
What if two interfaces have the same function declaration and I implement both these interfaces in the same class?
What will be the result of this??
Thank u...
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
krisp,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if two interfaces have the same function declaration and I implement both these interfaces in the same class?
What will be the result of this??

Nothing special. The class would have fulfilled it's promise to both interfaces - to implement a method with the required signature. If the interfaces were expecting different results from the implemented method, then you're likely to have a problem one day when a client using the class doesn't get the results promised by the interface's API.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic