**Answer:**
In Java, you compare strings using the `.equals()` method, not the `==` operator. The `.equals()` method checks whether two strings have the **same value (content)**, while `==` checks whether they refer to the **same object in memory**.
Here’s a simple example:
```java
String str1 = "hello";
String str2 = "hello";
String str3 = new String("hello");
System.out.println(str1 == str2); // true (both refer to same string literal)
System.out.println(str1 == str3); // false (different objects)
System.out.println(str1.equals(str3)); // true (same content)
```
To compare strings **ignoring case**, use `.equalsIgnoreCase()`:
```java
String str4 = "HELLO";
System.out.println(str1.equalsIgnoreCase(str4)); // true
```
Always use `.equals()` or `.equalsIgnoreCase()` when comparing string values in Java.