Front
What is the result of
int x = 5 / 2; in Java?Back
2
Integer division truncates the decimal;
5 / 2 is 2, not 2.5.Master AP Computer Science A with 50 flashcards covering Java fundamentals, OOP, arrays, recursion, and algorithms.
Front
int x = 5 / 2; in Java?Back
5 / 2 is 2, not 2.5.Front
String objects for equality in Java?Back
if (str1.equals(str2)) checks content; == checks if they are the same memory reference.Front
Integer.MAX_VALUE + 1?Back
Front
String.substring(2, 5) return for the string "Computer"?Back
Front
(double) 1 / 4?Back
Front
String object mutable or immutable?Back
toUpperCase() return a new String.Front
"1" + 2 + 3?Back
"1" + 2 becomes "12", then "12" + 3.Front
final keyword when declaring a variable?Back
final int X = 10; prevents the value of X from being reassigned.Front
&&?Back
if (false && 5/0 == 0) will not throw an error because the second part is never evaluated.Front
!(A && B) is equivalent to what?Back
+ 40 more cards
Sign up for free to copy this deck and start learning with spaced repetition.
Get started for free