AP® Computer Science A glossary
equals
Course: AP® Computer Science A Shows up in: Unit 1: Using Objects and Methods
The String method equals(Object other), which returns true if both strings have the same sequence of characters.
Appears in the course and exam description (CED): 1.15.B.2
equals is case-sensitive: "Cat".equals("cat") is false. The == operator only checks whether two references point to the same object.
String a = "go";
String b = new String("go");
System.out.println(a.equals(b));
System.out.println(a == b);
Output:
true
false Learn it properly, with a checkpoint 1.15 String Manipulation