Core java interview questions on access specifiers and packages

1.What is package?
Wrapping of class.

2.Do I need to import java.lang.package any time?Why?
No. It is by default loaded internally by the JVM.

3.Can I import same package/class twice?Will JVM load the package twice at runtime?

4.What is static import?
When we use static keyword before a package all the classes inside that package are imported by static import there is no need for using class name.

Related Post