Aryan PrajapatKnowledge Contributor
Is it possible to import the same class or package twice in Java and what happens to it during runtime?
Is it possible to import the same class or package twice in Java and what happens to it during runtime?
The same package or class may be imported more than once. Neither the JVM nor the compiler raise an objection. Even if you import the same class several times, the JVM will only internally load it once.