| Author |
JVM loading concept
|
vardhan reddy
Ranch Hand
Joined: Oct 28, 2011
Posts: 42
|
|
Hi All,
How JVM will find is loading file is class or interface. How it will find extended/implemented files.
Thanks.
|
 |
Anayonkar Shivalkar
Bartender
Joined: Dec 08, 2010
Posts: 1295
|
|
vardhan reddy wrote:Hi All,
How JVM will find is loading file is class or interface. How it will find extended/implemented files.
Thanks.
Well, I'm not sure if I understand your question correctly, but this is what I think:
1) When we write a class or interface, we clearly mention in code that whether it is a class or interface right? So, I don't think JVM should face any issues while identifying if it is class or interface.
2) JVM couples classpath and package hierarchy (i.e. import and package statements) to search classes.
|
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD)
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 5893
|
|
vardhan reddy wrote:Hi All,
How JVM will find is loading file is class or interface.
By searching in the classpath.
How it will find extended/implemented files.
It's not clear what you're asking here. If you're asking, given a particular class or interface, how does the JVM find all its subclasses or subinterfaces, the answer is that it doesn't. If B extends A, the JVM doesn't know that until it loads B when our code first uses it. It doesn't find B when it loads A.
|
 |
 |
|
|
subject: JVM loading concept
|
|
|