• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

JVM loading concept

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

How JVM will find is loading file is class or interface. How it will find extended/implemented files.

Thanks.
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic