Java Basics  «Prev  Next»

Using Java Packages - Quiz

Each question is worth one point. Select the best answer for each question.
 

1. To import a class called Panel that's in the java.awt package, you can write
Please select the best answer.
  A. import java.awt; at the end of your source file
  B. import java.awt; at the top of your source file
  C. import java.awt.*; at the top of your source file
  D. import "java.awt.Panel"; at the top of your source file


2. To define a new package, you should:
Please select the best answer.
  A. Write the keyword package at the top of your source file, followed by the name of the package.
  B.
Write the keyword package anywhere in your source file, followed by the name of the package.
  C. Compile your source code using the -d option found in the JDK compiler.
  D. Call tech support.


Your score is 0.0