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

Interface  RSS feed

 
Rajan Venkat
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There is an Application Interface which has three methods

activateAppl()
deactivateAppl()
getApplicationName()

The class Application1 implements Application interface and it has implemented the above three methods.

Another class Application2 extends Application1 and overrided two methods
activateAppl(); and deactivateAppl() except getApplicationName().

Now i want load the class which implements Application interface.

wheather Application2 is eligible to load or not.

Please answer me
 
Adam Schaible
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By load, do you mean instantiated (IE: create an object of that type)?

If so, both Application1 and Application2 are able to be instantiated.

Application2 IS A(n) Application1 - it inherits the method it doesn't override.

should work fine
 
Rajan Venkat
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No ..Load means loading the class through class loader and i want to know wheather the Application2 is eligible to load or not because the class which needs to be loaded must implement Application interface.

Since it extends the Application1 which implements Application means that Application2 is also implemented the interface ?
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indirectly yes.
 
abhishek pendkay
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes it is eligible to be loaded because of the rules of polymorphism
 
Adam Schaible
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rajan Venkat:
[QB]No ..Load means loading the class through class loader and i want to know ...[QB]


I realize english isn't your first language, and I wanted to make sure I understood your question correctly. Regardless, though - it's transitive, the same rules apply.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!