D
Dipankar
Hi,
Recently I wrote a certification test for Java2. There was a question
on using wildcards in import statement with four options. Only one
among them is correct (as per the test paper).
I was not very sure about the answer.
Can anyone help me in finding the answer?
Question
import java.util.*;
What is the disadvantage of using "*" in an import statement as shown
in the sample above?
Choice 1 : The class file is less portable.
Choice 2 : The Java Virtual Machine takes slightly longer to
validate the class file.
Choice 3 : The maximum number of classes allowed to be imported is
limited to 128.
Choice 4 : The code dependencies are difficult to evaluate from
reading the code.
Choice 5 : The Java Virtual Machine takes slightly longer to load the
class file.
According to me the Choice 4 is correct. But I am not sure about the
impact on JVM while using wildcards.
Thanks in advance.
Recently I wrote a certification test for Java2. There was a question
on using wildcards in import statement with four options. Only one
among them is correct (as per the test paper).
I was not very sure about the answer.
Can anyone help me in finding the answer?
Question
import java.util.*;
What is the disadvantage of using "*" in an import statement as shown
in the sample above?
Choice 1 : The class file is less portable.
Choice 2 : The Java Virtual Machine takes slightly longer to
validate the class file.
Choice 3 : The maximum number of classes allowed to be imported is
limited to 128.
Choice 4 : The code dependencies are difficult to evaluate from
reading the code.
Choice 5 : The Java Virtual Machine takes slightly longer to load the
class file.
According to me the Choice 4 is correct. But I am not sure about the
impact on JVM while using wildcards.
Thanks in advance.