How JVM will find is loading file is class or interface. How it will find extended/implemented files.
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.
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.