Page 899 - AP Computer Science A, 7th edition
P. 899

8. (D) Test I is correct because it’s OK to compare primitive types (in this case int values) using ==. Test III works because k.toString() and m.toString() are Strings, which should be compared with equals. Test II is wrong because you can’t invoke a method (in this case equals) on an int.


































































































   897   898   899   900   901