The import Statement

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

T or F: The String class is part of the java.util package.

False It's part of the java.lang package.

T or F: In a program, a class must always be referred to using its fully qualified name.

False The import statement allows us to avoid always using the fully qualified name.

T or F: The classes of the java.util package are automatically imported into every Java program.

False The only package automatically imported is java.lang

T or F: An import statement should be written inside a class but before any methods.

False It should be written above the class.

T or F: Two classes can have the same name if they are in different packages.

True That way each class name doesn't have to be unique.

T or F: An import statement tells the compiler which class you're referring to in a program.

True The package and class names together uniquely identify the class.

T or F: A static import let's you refer to a static method without using its class name.

True Though it may mask the source of the method.

T or F: An entire package can be imported using one import statement.

True Using the wildcard * character.


Set pelajaran terkait

Chapter 7 Study Guide Photosynthesis

View Set

Cardiovascular, Hematologic, and Lymphatic Systems

View Set

Chapter 17 Lecture Module Questions

View Set

Algebra II: Expressions, Equations, and Inequalities Unit Test

View Set