String Class & Immutability in Java

🟢 Beginner Level | Java Core Syntax

📖 Definition

The Java String class represents immutable character sequences stored in the String Constant Pool inside JVM Heap memory.

âš¡ Code Example

String s1 = "Java";
String s2 = "Java";
System.out.println(s1 == s2); // true (Same Constant Pool reference)
System.out.println(s1.equalsIgnoreCase("JAVA")); // true

🧭 Navigation

← Module Hub | Module Hub | 02. StringBuilder Class →