Question-69: What is package?
Answer:
A package is a group of similar type of classes interfaces and sub packages. It provides access protection and removes naming collision.
Question-70:Do I need to import java.lang package any time? Why ?
Answer:
No. It is by default loaded internally by the JVM.
Question-71: Can I import same package/class twice? Will the JVM load the package twice at runtime?
Answer:
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.
Question-72: What is static import ?
Answer:
By static import, we can access the static members of a class directly, there is no to qualify it with the class name.
Answer:
A package is a group of similar type of classes interfaces and sub packages. It provides access protection and removes naming collision.
Question-70:Do I need to import java.lang package any time? Why ?
Answer:
No. It is by default loaded internally by the JVM.
Question-71: Can I import same package/class twice? Will the JVM load the package twice at runtime?
Answer:
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.
Question-72: What is static import ?
Answer:
By static import, we can access the static members of a class directly, there is no to qualify it with the class name.
No comments:
Post a Comment