0 votes
in JAVA by
Can I import same package/class twice? Will the JVM load the package twice at runtime?

1 Answer

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

Related questions

0 votes
asked Apr 8, 2021 in JAVA by SakshiSharma
0 votes
asked Apr 30, 2021 in JAVA by rajeshsharma
...