O'Reilly logo

Java 2™ Programmer Exam Cram™ 2 (Exam CX-310-035) by Marcus Green, Bill Brogden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exam Prep Practice Questions

Question 1 You are writing a utility class and your company's policy is to keep utility classes in a package named conglomo.util. Select the correct code fragment to start a class file for a class that uses classes in the java.awt and java.util standard library packages.
  • A.

    1. package java.conglomo.util
    2. import java.awt.*
    3. import java.util.*
    
  • B.

    1. package conglomo.util ;
    2. import java.awt.* ;
    3. import java.util.* ;
    
  • C.

    1. import java.awt.* ;
    2. import java.util.* ;
    3. import conglomo.util.* ;
    
  • D.

    1. package conglomo.util ;
    2. import java.*.* ;
    
A1: Answer B is correct. Note that the package statement must be the first compiler-usable statement. It can follow comment lines and blank lines but must precede all ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required