nerdexam
Oracle

1Z0-804 · Question #135

Given two classes in separate files: Which two import statements can make the a.b.parent class compliable?

The correct answer is B. import a.b.c.Child; C. import a.b.c.*. To import a specific member into the current file, put an import statement at the beginning of thefile before any type definitions but after the package statement, if there is one.C:To import all the types contained in a particular package, use the import statement with the…

Java Class Design

Question

Given two classes in separate files:

Which two import statements can make the a.b.parent class compliable?

Options

  • Aimport a.b.c.Parent;
  • Bimport a.b.c.Child;
  • Cimport a.b.c.*;
  • Dimport a.b.*;
  • Eimport a.*;

How the community answered

(53 responses)
  • A
    11% (6)
  • B
    81% (43)
  • D
    2% (1)
  • E
    6% (3)

Explanation

To import a specific member into the current file, put an import statement at the beginning of thefile before any type definitions but after the package statement, if there is one.C:To import all the types contained in a particular package, use the import statement with the asterisk (*)wildcard

Topics

#import statements#package structure#class visibility#subclass import

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice