Home > DeveloperSection > Interviews > Can I import same package/class twice? Will the JVM load the package twice at runtime?

Posted on    April-22-2015 12:30 AM

 Java Java 
 1 Answer(s)
  589  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Posted on    April-22-2015 12:30 AM

One can import the same package or same class multiple times. Neither compiler nor JVM complains about it.But the JVM will internally load the class only once no matter how many times you import the same class

Don't want to miss updates? Please click the below button!

Follow MindStick