---
title: "Can I import same package/class twice? Will the JVM load the package twice at runtime?"  
description: "Can I import same package/class twice? Will the JVM load the package twice at runtime?"  
author: "Anonymous User"  
published: 2015-04-22  
updated: 2020-09-20  
canonical: https://www.mindstick.com/interview/2422/can-i-import-same-package-class-twice-will-the-jvm-load-the-package-twice-at-runtime  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# Can I import same package/class twice? Will the JVM load the package twice at runtime?

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

## Answers

### Answer by Anonymous User

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


---

Original Source: https://www.mindstick.com/interview/2422/can-i-import-same-package-class-twice-will-the-jvm-load-the-package-twice-at-runtime

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
