Java Learning Journey – Day 5 Today I explored one of the most commonly used concepts in Java — Strings. Strings are used to store and manipulate text data, and almost every Java application uses them in some way. 🔹 Key things I learned today: • Creating Strings – String name = "Java Learner"; • Concatenation – Joining two strings together using + • Finding Length – Using length() to know the size of a string • Accessing Characters – Using charAt() 🔹 Useful String Methods: • toUpperCase() / toLowerCase() – Change letter case • indexOf() / contains() – Search inside strings • substring() – Extract part of a string • replace() – Replace text • split() – Break string into parts • trim() – Remove extra spaces 💡 Why Strings are important? Because most real-world applications deal with text processing, user input, and data handling. Learning step by step and building a strong foundation in Java every day. If you're learning Java or working in development, feel free to connect and share your journey. 🤝 #Java #JavaDeveloper #Programming #CodingJourney #SoftwareDevelopment #LearnJava
Java Strings: Key Concepts and Methods
More Relevant Posts
-
🚀 Day 22/100 – Java Learning Series Today I explored important looping and control concepts in Java, along with handling user input in programs. 🔹 while Loop The while loop executes a block of code as long as a condition remains true. It is useful when the number of iterations is not known beforehand. Syntax: while(condition){ // code } 🔹 do-while Loop The do-while loop is similar to the while loop, but it executes the code at least once, even if the condition is false. Syntax: do{ // code } while(condition); 🔹 Jumping Statements Jumping statements control the flow of loops and program execution. ✔ break – terminates the loop immediately ✔ continue – skips the current iteration and moves to the next ✔ return – exits from a method 🔹 Scanner Class The Scanner class (from java.util package) is used to take input from the user during program execution. Example: import java.util.Scanner; Scanner sc = new Scanner(System.in); int num = sc.nextInt(); 💡 Key Learning: Combining loops + jumping statements + user input helps build interactive and dynamic Java programs. Consistency in learning is the path to mastering programming. 💻🔥 #Java #JavaProgramming #CodingJourney #LearnJava #Programming #SoftwareDevelopment #JavaDeveloper #100DaysOfCode #10000 Coders #Meghana M
To view or add a comment, sign in
-
🚀 Day 2 of Java Training – Strengthening Core Concepts Today was Day 2 of the Java training program conducted by our college, and it was another great learning experience. In today’s session, we covered several important Java concepts including Implicit and Explicit Type Casting, which helped us understand how Java handles data type conversions. We also learned about Wrapper Classes and their role in converting primitive data types into objects. The faculty introduced us to Command Line Arguments, showing how inputs can be passed to a Java program while executing it from the command line. We also started exploring Object-Oriented Programming (OOP) concepts and completed the fundamentals of Classes and Objects. Additionally, we discussed the importance of the public static void main method and clearly understood the difference between static and non-static methods. Each day of this training is helping me build a stronger foundation in Core Java, and I’m excited to continue learning more advanced concepts in the coming sessions. #Java #OOP #Programming #LearningJourney #SoftwareDevelopment #JavaDeveloper
To view or add a comment, sign in
-
-
🚀 Day 29 | Core Java Learning Journey 📌 Topic: TreeSet in Java Today, I learned about TreeSet, an important class in the Java Collections Framework used when we need sorted and unique elements. 🔹 TreeSet in Java ✔ TreeSet is a class that implements NavigableSet ✔ It also indirectly implements SortedSet and Set ✔ Introduced in JDK 1.2 ✔ Stores unique elements only (no duplicates allowed) 🔹 Data Structure Used ✔ Based on Self-Balancing Binary Search Tree (Red-Black Tree) ❗ (important correction) ✔ Elements are stored in sorted order 🔹 Key Features ✔ Does NOT follow insertion order ✔ Follows natural sorting order (default) ✔ Allows custom sorting using Comparator ✔ Does NOT allow null elements ❌ ✔ Stores homogeneous data (same type, for proper comparison) 📌 Important Methods • add() – add element • remove() – delete element • contains() – check element • first() – returns first (smallest) element • last() – returns last (largest) element • higher() – next greater element • lower() – next smaller element 📌 Performance ✔ Operations like add, remove, search → O(log n) 📌 When to Use TreeSet? ✔ When you need: ✅ Sorted data ✅ Unique elements ✅ Range-based operations 💡 Note: Unlike HashSet, TreeSet focuses on sorting rather than speed. 🙏 Special thanks to Vaibhav Barde Sir for the guidance! 🔥 #CoreJava #JavaLearning #JavaDeveloper #TreeSet #SortedSet #NavigableSet #JavaCollections #Programming #LearningJourney
To view or add a comment, sign in
-
-
📘 Back to Learning Java – Rules of Method Overloading After a short break of a week, I started learning again and today’s focus was on Rules of Method Overloading, beginning with the first rule: Access Modifiers. 🔹 Access Modifiers are used to modify the accessibility (visibility) of variables and methods. We learned the four types of access modifiers in Java: 1️⃣ Public ✔ Can be used in the same class ✔ Different class in the same package ✔ Different package (with and without inheritance) 2️⃣ Protected ✔ Can be used in the same class ✔ Different class in the same package ✔ Different package (only if it is inherited) 3️⃣ Package (Default) ✔ Can be used in the same class ✔ Same package 4️⃣ Private ✔ Can be used only inside the same class ❌ Cannot be inherited or accessed outside the class 💡 To understand this better, we created multiple packages and classes and tested how each access modifier behaves in different scenarios. 🔎 Key Conclusion: If you use access modifiers from bottom → top, the accessibility/visibility increases. private → package → protected → public If you use them from top → bottom, the visibility decreases. Always interesting to see how these concepts work practically while coding! 💻 #Java #LearningJava #AccessModifiers #Programming #CodingJourney #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Starting My Java Learning Journey – Day 9 🔹 Topic: Method Overloading in Java Method Overloading is a feature in Java that allows a class to have multiple methods with the same name but different parameters. It helps improve code readability and flexibility. 📌 Ways to Achieve Method Overloading 1️⃣ Different number of parameters 2️⃣ Different data types of parameters 📌 Example Program public class Main { // Method with two int parameters static int add(int a, int b) { return a + b; } // Method with three int parameters static int add(int a, int b, int c) { return a + b + c; } public static void main(String[] args) { System.out.println(add(5, 10)); System.out.println(add(5, 10, 15)); } } Output: 15 30 💡 Key Points: ✔ Method overloading allows multiple methods with the same name ✔ Methods must differ in number or type of parameters ✔ Helps make programs more flexible and readable #Java #JavaLearning #Programming #BackendDevelopment #CodingJourney #MethodOverloading
To view or add a comment, sign in
-
🚀 Day 2/45 – Understanding Variables and Data Types in Java Today was the second day of my 45 days Java learning journey, and I focused on understanding one of the most fundamental concepts in programming: Variables and Data Types. In any programming language, variables act as containers that store data which can be used and manipulated throughout a program. Learning how to declare and use them correctly is an important step toward writing efficient programs. 📚 What I Learned Today Today I explored how Java handles different types of data and how they are stored in memory. Some of the key concepts I learned include: ✔ Declaring and initializing variables in Java ✔ Understanding primitive data types such as int, double, char, and boolean ✔ How variables help store and manage values in a program ✔ Writing simple programs using variables for calculations and output 💻 Practice Programs To strengthen my understanding, I practiced small programs such as: • Storing and printing student details using variables • Adding two numbers using integer variables • Calculating the area of a rectangle using length and width variables Example: class Addition { public static void main(String args[]) { int a = 10; int b = 20; int sum = a + b; System.out.println("Sum = " + sum); } } 🎯 Key Takeaway Even though variables and data types seem simple, they are the foundation of programming logic. Mastering these basics will make it easier to learn advanced concepts like loops, functions, and object-oriented programming. I will continue learning and sharing my progress as I move forward in this journey. #Java #Programming #LearningInPublic #CodingJourney #SoftwareDevelopment #Consistency
To view or add a comment, sign in
-
Learning Java for nearly two years has presented many challenges, particularly in building a strong foundation in core Java concepts. To clarify my understanding, I began creating structured notes that are easily updated, organized, and improved over time. This effort has proven extremely beneficial in strengthening my grasp of Java fundamentals. I am sharing this document here to assist other Java developers or students in their learning journey. It currently covers core Java fundamentals such as: - Identifiers - Reserved words - Primitive data types - Variables - Arrays - Operators - Type casting - Flow control statements - Loops Additionally, it includes important concepts like var-args methods, the main() method structure, and Java Bean coding standards. Feel free to use it, and I hope it aids you in your Java learning experience. #Java #JavaDeveloper #JavaFundamentals #Programming #JavaProgramming #JavaNotes
To view or add a comment, sign in
-
🚀 I completed Day 3 of my Java learning using the W3Schools platform.Today, I studied about java Operators, Strings, and Type Casting.” This helped me understand how Java handles data transformation and manipulation. First, I learned about Type Casting, which is used to convert one data type into another. I understood that Java is a strictly typed language, so data must be converted carefully when moving between different types. I also learned about automatic casting (widening) such as converting "int" to "double", and manual casting (narrowing) where a larger type like "double" is converted to a smaller type like "int", which may cause loss of decimal values. Next, I explored operators in Java, which act as the logic engine of a program. These include arithmetic operators ("+ - * / %"), assignment operators, comparison operators ("==, >, <, >=, <="), and logical operators ("&&, ||, !"). I also learned how the “+” operator can be used not only for arithmetic calculations but also for string concatenation. Another important concept I studied was Strings in Java. I learned that strings are objects with built-in methods that allow us to analyze and manipulate text. Some useful string methods include "length()", "charAt()", "indexOf()", and "toUpperCase()" which help in processing text data effectively. Finally, I saw how these concepts work together in a practical example where operators, type casting, and string concatenation are used to calculate and display a score percentage in a program. #Java #Programming #LearningJourney #SoftwareDevelopment #W3schools
To view or add a comment, sign in
-
🚀 Day 26 of My Java Learning Journey – Copy Constructor Today, I explored the concept of Copy Constructor in Java 💡 🔹 A copy constructor is used to create a new object by copying the values of an existing object. 🔹 It helps in avoiding reference issues and ensures better control over object data. 📌 Key Learnings: ✔️ How to create a copy constructor ✔️ Difference between Shallow Copy and Deep Copy ✔️ Why copy constructors are preferred over "clone()" in many cases 💻 Example Insight: Creating a new object using another object: "Student s2 = new Student(s1);" 📊 This ensures both objects have the same values but can be handled independently when needed. 🔥 Understanding this concept is very useful for: - Object duplication - Data safety - Real-world applications involving object manipulation 📅 Consistency is key — 26 days strong and still going! 💪 Looking forward to learning more advanced concepts in the coming days. #Java #LearningJourney #100DaysOfCode #Programming #Developers #OOP #JavaDeveloper # 10000 Coders #Meghana M
To view or add a comment, sign in
-
Java Learning Journey – Day 7 Today I practiced an important concept in Java — Decision Making using If-Else and Switch Statements. These statements help a program choose different actions based on conditions. 🔹 If-Else Statement Used when a program needs to check a condition and execute different blocks of code. Example: if (temp > 30) { System.out.println("It's hot!"); } else { System.out.println("It's not hot."); } 🔹 Switch Statement Used when there are multiple possible cases for a single value. Example: switch(day) { case 1: System.out.println("Monday"); break; case 2: System.out.println("Tuesday"); break; default: System.out.println("Invalid day"); } 💡 Why this is important? Because real-world programs constantly make decisions based on conditions. Learning step by step and strengthening my Java programming fundamentals every day. If you're learning Java or working in development, feel free to connect and share your journey. 🤝 #Java #JavaDeveloper #Programming #CodingJourney #SoftwareDevelopment #LearnJava #Hariom #HariomKumar
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