๐Ÿ’ปap computer science a review

.equals(String string)

Written by the Fiveable Content Team โ€ข Last updated August 2025
Verified for the 2026 exam
Verified for the 2026 examโ€ขWritten by the Fiveable Content Team โ€ข Last updated August 2025

Definition

The .equals(String string) method is used to compare two strings for equality. It checks if both strings have exactly the same characters in the same order.

".equals(String string)" also found in: