📘 Understanding Java Strings-Class 01 Strings in Java are objects that represent a sequence of characters enclosed in double quotes. 🔹 Strings are of two types: Immutable – Cannot be changed (Example: Gender, Date of Birth) Mutable – Can be changed (Example: Password) 🔹 The String class in Java is immutable. 🔹 String Creation: Without new keyword → Stored in String Constant Pool With new keyword → Stored in Heap Memory 🔹 String Comparison Methods: == (Reference comparison) .equals() (Content comparison) .compareTo() (Lexicographical comparison) .equalsIgnoreCase() (Ignores case differences) ⚠️ Java is case-sensitive. TAP Academy #Java #CoreJava #Programming #Learning #Developers #JavaStrings
Java Strings: Immutable and Mutable Types
More Relevant Posts
-
🚀 Day – Java Learning Update ⏳ 🎯 Understanding Switch Case in Java Today, I learned about the Switch Case statement in Java, which is used to execute different blocks of code based on the value of a variable or expression. It is mainly used when we have multiple conditions to check for a single variable, making the code more readable compared to many if-else statements. 🔹 What is Switch Case? The switch statement allows a variable to be tested against multiple possible values called cases. ✔ Each case represents a possible value ✔ break stops execution after a case runs ✔ default runs if no case matches 🔹 Syntax of Switch Case switch(expression) { case value1: // code block break; case value2: // code block break; case value3: // code block break; default: // default code block } 🧑💻 Task Practiced: Traffic Signal Program I implemented a simple program using switch case to represent a traffic signal. #Java #CoreJava #JavaFullStack #SwitchCase #Programming #SoftwareDeveloper #LearningJourney 10000 Coders Meghana M
To view or add a comment, sign in
-
-
Random Java Knowledge Drop Did you know? 👀 In Java, calling run() on a thread does NOT create a new thread. It runs just like a normal method on the current thread. 👉 Only start() creates a new thread and calls run() internally. Why this matters: Many beginners think run() = multithreading ❌ This mistake can cause performance issues and bugs Small concepts like these make a big difference in real projects. Learning Java one concept at a time 🚀 More such small knowledge drops coming soon! 👍 Like if this was new to you 💬 Comment if you already knew this #Java #Learning #DeveloperTips #Programming #JavaDeveloper
To view or add a comment, sign in
-
💻 Java Programming Practice – Find the Largest Word in a Sentence. Today I practiced a Java program to find the largest word in a sentence. 📌 What this program does: • Takes a sentence input from the user • Splits the sentence into individual words • Compares the length of each word • Displays the largest word in the sentence ✅ Example: Sentence: I am Dinesh from Tiruvannamalai Output: Largest word in the sentence = Tiruvannamalai 💡 Concepts used in this program: ✔ Java Scanner input ✔ String split() method ✔ Loops ✔ String length comparison I am practicing Java programs daily to improve my coding and problem-solving skills for IT placements. #Java #Programming #CodingPractice #JavaDeveloper #Learning #SoftwareDevelopment
To view or add a comment, sign in
-
-
💻 Java Programming Practice – Reverse a String. Today I practiced a Java program to reverse a string. 📌 What this program does: • Takes a string input from the user • Reads each character from the end of the string • Builds a new reversed string • Displays the reversed output ✅ Example: Input: Tiruvannamalai Output: ialamannavuriT 💡 Concepts used in this program: ✔ Java Scanner input ✔ String length method ✔ For loop ✔ Character handling I am practicing Java programs daily to improve my coding and problem-solving skills for IT placements. #Java #Programming #CodingPractice #JavaDeveloper #Learning #SoftwareDevelopment
To view or add a comment, sign in
-
-
🔹 Java Practice: Frequency Count + Single Number Detection 🔹 Today I practiced a small but useful Java problem: counting the frequency of elements in an array and also identifying the element that appears only once. In this program, I used a boolean array to mark elements that were already processed so that duplicates are not counted multiple times. For each element, I compared it with the remaining elements, increased the count when matches were found, and marked those positions as visited. This approach helped me achieve two things in one pass of logic: ✔️ Print how many times each number occurs ✔️ Detect and display the number that appears only once Working on such problems strengthens understanding of loops, conditions, arrays, and basic problem-solving logic in Java. Small exercises like these build the foundation for writing efficient algorithms later. #Java #Programming #CodingPractice #DataStructures #Learning #StudentDeveloper
To view or add a comment, sign in
-
-
💻 Java Programming Practice – Capitalize First Letter of Each Word. Today I practiced a Java program to capitalize the first letter of each word in a sentence. 📌 What this program does: • Takes a sentence input from the user • Splits the sentence into individual words • Converts the first character of each word to uppercase • Displays the updated sentence ✅ Example: Input: good morning Output: Good Morning 💡 Concepts used in this program: ✔ Java Scanner input ✔ String split() method ✔ Character array conversion ✔ Loops and conditions I am practicing Java programs daily to improve my coding and problem-solving skills for IT placements. #Java #Programming #CodingPractice #JavaDeveloper #Learning #SoftwareDevelopment
To view or add a comment, sign in
-
-
Java Just Got Simpler with Java 25 Java is evolving to reduce boilerplate and improve developer productivity. This visual shows how writing a simple Java program is becoming cleaner and more beginner-friendly. Before Java 25 - Required class declaration - Mandatory public static void main(String[] args) - More boilerplate for basic programs After Java 25 - No explicit class declaration - Simplified main method - Faster setup for beginners and rapid testing Why this update matters: - Easier learning curve for students - Cleaner code for quick experiments - Better focus on logic, not syntax - Ideal for academic projects and assignments If you need help with Java assignments, version upgrades, or project implementation, message us or click the link to get expert support. Follow me Md Shibly Sadik for more #Java #Java25 #Programming #SoftwareDevelopment #ComputerScience #CodingHelp #StudentSupport #LearnJava
To view or add a comment, sign in
-
-
☕ Java Output Methods Explained – print() vs println() vs \n When learning Java programming, understanding how output works is very important. In the example program, three different output methods are used: 📌 What happens here? ✔ println() → Prints the text and moves the cursor to the next line ✔ print() → Prints the text but stays on the same line ✔ \n → Creates a manual line break (newline character) 💡 Output of this program: Hello World! Hello JishanHii Jishan Because print() does not move to the next line, the second and third outputs appear on the same line. Understanding these small details is essential when learning Java fundamentals and writing clean console output. 🚀 Every Java developer starts with simple programs like this before building large applications. 👉 Question for developers: Do you prefer using println() or \n for line breaks in Java? #Java #JavaProgramming #Coding #Programming #SoftwareDevelopment #BackendDevelopment #JavaDeveloper #LearnJava #ComputerScience #CodingTips
To view or add a comment, sign in
-
-
🚀 Day 24 at Tap Academy – Mutable Strings in Java Today’s learning was about Mutable Strings in Java and how they differ from normal String objects. 🔹 In Java, String objects are immutable – once created, they cannot be changed. To overcome this limitation, Java provides mutable string classes: ✅ StringBuffer Mutable class Thread-safe (synchronized) Slower compared to StringBuilder Used in multi-threaded environments ✅ StringBuilder Mutable class Not thread-safe Faster than StringBuffer Preferred in single-threaded applications ✅ StringTokenizer Used to break a string into tokens Helpful for parsing data Works based on delimiters (like space, comma, etc.) 💡 Key Takeaway: Understanding the difference between String, StringBuffer, and StringBuilder helps in writing efficient and optimized Java programs. Every day I’m learning something new and strengthening my core Java concepts 💻🔥 #Java #Programming #TapAcademy #CodingJourney #Learning
To view or add a comment, sign in
-
-
💻 Java Programming Practice – Count Repeated Character. Today I practiced a Java program to count how many times a character appears in a string. 📌 What this program does: • Takes a string input from the user • Takes a character to check • Compares the character with each letter in the string • Counts how many times the character appears ✅ Example: String: saravanan Character: a Output: Repeated character count = 4 💡 Concepts used in this program: ✔ Java Scanner input ✔ String methods ✔ For loop ✔ Character comparison I am practicing Java programs daily to improve my coding and problem-solving skills for IT placements. #Java #Programming #CodingPractice #JavaDeveloper #Learning #SoftwareDevelopment
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development