Strings are fundamental in Java programming. Here's a quick overview of key concepts and operations:

🔧 Basic String Operations

  • Concatenation: Use + to join strings
    String greeting = "Hello" + " " + "World";
    
  • Length: Check string length with .length()
    int len = greeting.length(); // Returns 11
    
  • Substring: Extract parts of a string
    String part = greeting.substring(0, 5); // "Hello"
    

🧱 Java String Classes

  1. String
    Immutable sequence of characters
    Learn more

  2. StringBuilder
    Mutable string operations (non-thread-safe)

    Java_StringBuilder

  3. StringBuffer
    Thread-safe alternative to StringBuilder

    Thread_Safe_String

⚠️ Important Notes

  • Strings are immutable in Java 💡
  • Use equals() for content comparison, not ==
  • Escape special characters with \ (e.g., \n, \t)

For advanced topics like regex or string formatting, check our Java String Patterns guide!