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

3. Operators and Assignments

3.1 (a)

A value of type char can be assigned to a variable of type int. An implicit widening conversion will convert the value to an int.

3.2 (d)

An assignment statement is an expression statement. The value of the expression statement is the value of the expression on the right hand side. Since the assignment operator is right associative, the statement a = b = c = 20 is evaluated as follows: (a = (b = (c = 20))). This results in the value 20 being assigned to variable c, then the same value being assigned to variable b and finally to variable a. The program will compile correctly and display 20 when run.

3.3 (c)

Strings are objects. The variables a, b, and c are references that can denote such objects. Assigning to ...

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