Question 1 of 10
A pantry tracks unused jars. What text does this Java code display?
int jars = 9;
System.out.print(jars == 4);
- A. false
- B. true
- C. 9
- D. 4
A pantry tracks unused jars. What text does this Java code display?
int jars = 9;
System.out.print(jars == 4);
A shuttle logs remaining fuel units. What text does this Java code display?
int fuel = 40;
System.out.print(fuel != 17);
A warehouse restacks cartons. What text does this Java code display?
int cartons = 6;
System.out.print(cartons <= 6);
System.out.print(cartons < 6);
Beads are grouped by 7. What text does this Java code display?
int beads = 26;
System.out.print(beads / 7 == 3);
System.out.print(beads / 7 > 3);
A scale stores a double reading. What text does this Java code display?
int whole = 9;
double mix = 9.0;
System.out.print(whole / 2 > 4);
System.out.print(mix / 2 > 4);
Two badge objects are constructed. What text does this Java code display?
class Badge {
}
Badge first = new Badge();
Badge second = new Badge();
Badge copy = first;
System.out.print(first == second);
System.out.print(first == copy);
System.out.print(second != copy);
A trail marker is stored as char. What text does this Java code display?
char mark = 'C';
System.out.print(mark == 'C');
System.out.print(mark < 'A');
String tags are compared. Which expression is valid Java and tests whether the two variables refer to the same object?
String a = new String("hi");
String b = new String("hi");
A missing label is represented by null. What text does this Java code display?
String tag = null;
String other = new String("gate");
System.out.print(tag == null);
System.out.print(other == null);
An int counter wraps past its minimum value. What text does this Java code display?
int depth = -2147483648;
depth = depth - 1;
System.out.print(depth < 0);