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.10 Which statements are true?

Select the three correct answers.

  1. The result of the expression (1 + 2 + "3") would be the string "33".

  2. The result of the expression ("1" + 2 + 3) would be the string "15".

  3. The result of the expression (4 + 1.0f) would be the float value 5.0f.

  4. The result of the expression (10/9) would be the int value 1.

  5. The result of the expression ('a' + 1) would be the char value 'b'.

3.11 What happens when you try to compile and run the following program?
public class Prog1 {
    public static void main(String[] args) {
        int k = 1;
        int i = ++k + k++ + + k;
        System.out.println(i);
    }
}

Select the one correct answer.

  1. The ...

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