File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Interface" Watch "Interface" New topic
Author

Interface

Rajan Venkat
Ranch Hand

Joined: Dec 17, 2006
Posts: 35
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

Joined: Oct 04, 2007
Posts: 101
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

Joined: Dec 17, 2006
Posts: 35
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

Joined: Oct 27, 2005
Posts: 19216

Indirectly yes.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
abhishek pendkay
Ranch Hand

Joined: Jan 01, 2007
Posts: 184
yes it is eligible to be loaded because of the rules of polymorphism


The significant problems we face cannot be solved by the same level of thinking which created them – Einstein
SCJP 1.5, SCWCD, SCBCD in the making
Adam Schaible
Ranch Hand

Joined: Oct 04, 2007
Posts: 101
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Interface
 
Similar Threads
including jsp of other application
including the jsp of other application
dynamic WEB-INF/lib
Multiple Beans for same Home And Remote interfaces
Error 400 on iFrame when using a different DNS?