Java OCA OCP Practice Question 545

Question

Given the following class in the file /my/directory/named/A/Bird.java:


INSERT CODE HERE 
public class Bird { } 

Which of the following replaces INSERT CODE HERE if we compile from /my/directory?

Choose all that apply

  • A. package my.directory.named.a;
  • B. package my.directory.named.A;
  • C. package named.a;
  • D. package named.A;
  • E. package a;
  • F. package A;
  • G. Does not compile.


D.

Note

The package name represents any folders underneath the current path, which is named.A in this case.

Option B is incorrect because package names are case sensitive, just like variable names and other identifiers.




PreviousNext

Related