Back to articles
πŸš€ Day 30 of My Automation Journey – Strings in Java - part 1
How-ToSystems

πŸš€ Day 30 of My Automation Journey – Strings in Java - part 1

via Dev.tobala d kaveri

🧡 What is String in Java? If you are just starting with Java, one of the most important things you’ll learn is String . Don’t worry β€” we’ll explain this in a very simple way so that even a 10th-grade student can understand πŸ‘ πŸ“Œ 1. Introduction – What is a String? πŸ‘‰ A String in Java is simply a sequence of characters . Example: String name = "Bala" ; Here: "Bala" is a String It contains characters: B, a, l, a 🧠 Real-Life Example Think of a String like: Your name β†’ "Ravi" A sentence β†’ "I love Java" A password β†’ "abc123" πŸ‘‰ Anything inside double quotes (" ") is a String in Java. πŸ—οΈ 2. How String Came into Java (Origin) Java was created to be: Secure πŸ” Simple ✨ Reliable πŸ’ͺ So, the designers of Java made Strings: βœ… Immutable (Very Important Concept) πŸ‘‰ Once created, a String cannot be changed Why? Security (no one can modify passwords, URLs) Performance (reuse of same String) Thread safety (safe in multi-threading) 🧱 3. How String is Stored in Memory There are two ways Strings are created: πŸ”Ή M

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles