

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A java quiz focusing on operator precedence and valid java identifiers. The quiz includes multiple-choice questions and programming exercises. Students are required to evaluate java expressions using the given operator precedence table and determine the value of variables based on given conditions.
Typology: Exercises
1 / 2
This page cannot be seen from the preview
Don't miss anything!


this&that _thisRthat This_2_That boolean
_9_2_5 n!ne_2_5 9_2_5 bool
int a = 5; int b = -2; int c = 2;
boolean z = exp1 && exp2 || exp3; System.out.print( "z = " + z ); ____________________ z = exp3 || exp1 && !exp2; System.out.print( "z = " + z ); ____________________
b = --b + ++a % 4 * c++ * 2; System.out.print( "a = " + a ); ____________________ System.out.print( "b = " + b ); ____________________ System.out.print( "c = " + c ); ____________________
int a = 2; int b = 4; int c = 6;
System.out.println( (a + b) + c + " = " + a + (b + c) );
System.out.println( a + (b + c) + " = " + (a + b) + c );
System.out.println( (a + b + c) + " = " + a + b + c );
if ( (a > 1) || (b < -1) ) { if ( a > b ) { System.out.println( "A" ); } else { System.out.println( "B" ); } } else if ( (a == 1) && (b <= -1) ) { System.out.println( "C" ); } else { System.out.println( "D" ); }