Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about interface  RSS feed

 
Fred Victa
Ranch Hand
Posts: 206
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have this class that implements an interface:

class myClass implements myInterface<X, Y> {

}


I have another that extends the above class:

class myClass2 extends myClass{

}


Is it possible for myClass2 to change the datatype of the interface's arguments?



 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only if you've made the class generic as well. For example:
So if you want to be able to do that, you've got to plan for it.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!