O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

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

Review Questions

3.4 Which of the following expressions will be evaluated using floating-point arithmetic?

Select the three correct answers.

  1. 2.0 * 3.0

  2. 2 * 3

  3. 2/3 + 5/7

  4. 2.4 + 1.6

  5. 0x10 * 1L * 300.0

3.5 What is the value of the expression (1 / 2 + 3 / 2 + 0.1)?

Select the one correct answer.

  1. 1

  2. 1.1

  3. 1.6

  4. 2

  5. 2.1

3.6 What will be the result of attempting to compile and run the following program?
public class Integers {
    public static void main(String[] args) {
        System.out.println(0x10 + 10 + 010);
    }
}

Select the one correct answer.

  1. The program will not compile. The compiler will complain about the expression 0x10 + 10 + 010.

  2. When run, the program will print 28.

  3. When ...

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