Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Can I import same package/class twice? Will the JVM load the package twice at runtime?
Home
JAVA
Can I import same package/class twice? Will the JVM load the package twice at runtime?
asked
May 2, 2021
in
JAVA
by
sharadyadav1986
Can I import same package/class twice? Will the JVM load the package twice at runtime?
#package
java
jvm-load
Java-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
May 2, 2021
by
sharadyadav1986
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.
...