This operator is used to access methods and instance variables of an object.
What is the dot operator (or dot notation)
This String method returns the number of characters in a String.
What is length()?
This relational operator checks if two values are equal in a boolean expression.
What is == (double equals)?
This type of loop is best when you know exactly how many times you need to iterate.
What is a for loop?
The expression 6 + 3 / 2 * 2 evaluates to this value using proper order of operations.
What is 8? (6 + 1 * 2 = 6 + 2 = 8)
This type of method does not return a value and uses the keyword "void."
What is a void method?
For String s = "computer", s.substring(2, 5) returns this value.For String s = "computer", s.substring(2, 5) returns this value.
What is "put"?
To compare if two String objects have the same content, you should use this method instead of ==.
What is .equals()?
The for loop header for(int i = 0; i < 10; i += 2) will execute this many times.
What is 5 times? (i = 0, 2, 4, 6, 8)
After executing: int a = 5; a += 3; a *= 2; the final value of a is this.
After executing: int a = 5; a += 3; a *= 2; the final value of a is this.
This special method has the same name as the class and is used to create and initialize objects.
What is a constructor?
Math.random() returns a double value in this range.
What is 0.0 (inclusive) to 1.0 (exclusive)?
In short-circuit evaluation with the && operator, if the first condition is this value, the second condition is never evaluated.
What is false?
In a while loop, forgetting to update this variable inside the loop body can cause an infinite loop.
What is the loop control variable?
Given double a = (int)(6.5 - 3.5); and double b = (int)6.5 - 3.5;, the value of a - b is this.
What is 0.5? (a = 3.0, b = 2.5, so 3.0 - 2.5 = 0.5)
This special method has the same name as the class and is used to create and initialize objects.
What are arguments?
Given String word = "September", word.substring(0, 3) + word.substring(word.length() - 3) produces this output.
What is "Sepber"?
The expression !(x < 3) && !(x != 4 || x > 10) is equivalent to this simplified expression.
What is (x >= 3) && (x == 4 && x <= 10)?
The code segment that prints n % 4 for n starting at 10, incrementing by 5 each time while n <= 35, produces this output.
What is "2 3 0 1 2 3"?What is "2 3 0 1 2 3"?
In the scramble method, the call scramble("computer", 3) returns this String value.
What is "utercom"? (substring(4,8) + substring(0,3) = "uter" + "com")
Given a TestScore class with a bonus(int b) method that adds to the score, calling unit1.bonus(5) followed by unit1.getScore() when the original score was 80.0 returns this value.
What is 85.0?
The code (int)(Math.random() * 5) + 9 produces random integers in this interval.
What is 9 to 13 (inclusive)?
The boolean expression x || !y || !(x && y) will always evaluate to this value, regardless of the values of x and y.
What is true (always true)?
The nested loop with outer loop executing from x = 1 to 3 and inner loop executing from y = 3 to 0 (decrementing), calculating sum += x + y each iteration, produces this final sum value.
What is 42?
What is "utercom"? (substring(4,8) + substring(0,3) = "uter" + "com")
What is 19? (final values: num=0, val=5, ans=14)