Java OCA OCP Practice Question 86

Question

Given the following wildcard import statements, which class would be included in the import?

import myPkg.actor.*; 
import movie.director.*; 
A.  myPkg.actor.recurring.Marie 
B.  movie.directors.John 
C.  myPkg.actor.Package 
D.  movie.NewRelease 


C.

Note

Option A is incorrect as the sub-package recurring is not included by the import statements.

Option B is incorrect as it uses the plural directors instead of the singular director used in the import statements.

Option D is incorrect as the wildcard is applied to the sub-package movie.director, not the package movie.

Option C is correct as it is a valid class accessible from the wildcard import.




PreviousNext

Related