🚀 Day 6 | Core Java Learning Journey 📘 Topic: Looping Statements in Java Continuing my Core Java learning journey, today I explored loops in Java, which are used to execute a block of code repeatedly based on a given condition. Loops help reduce code redundancy and make programs more efficient and readable. 🔑 Concepts Explored Today: 🔹 for Loop Used when the number of iterations is known in advance. It is commonly used for counter-controlled loops. Syntax: for(initialization; condition; update) { // code to be executed } 🔹 while Loop Used when the number of iterations is not fixed. The condition is checked before executing the loop body. Syntax: while(condition) { // code to be executed } 🔹 do–while Loop Similar to the while loop, but the loop body executes at least once because the condition is checked after execution. Syntax: do { // code to be executed } while(condition); 📌 Why this matters: Loops are a fundamental part of programming and are essential for tasks like iteration, data processing, and automation. Understanding loops is crucial for writing efficient logic, working with arrays and collections, and building real-world Java applications. Special thanks to my mentor Vaibhav Barde Sir, for his guidance and clear explanation of Java loops, which made these concepts easy to understand. Step by step, strengthening my Core Java foundation and learning how to write cleaner and more optimized code. 💻🚀 #Java #CoreJava #Loops #ForLoop #WhileLoop #DoWhileLoop #ProgrammingFundamentals #JavaBasics #LearningJourney #BackendDevelopment #DailyLearning
Java Loops: For, While, Do-While Explained
More Relevant Posts
-
🌟 Day 30/100 of My Java Learning Journey! Today, I learned about Polymorphism, the third major concept of Object-Oriented Programming (OOPS) in Java. This concept helped me understand how the same action can behave differently in different situations. 🔹 What is Polymorphism? Polymorphism means “many forms.” In Java, it allows the same method name to perform different behaviors depending on the object or context. This helps make programs more flexible and scalable. 🔹 Types of Polymorphism in Java 1️⃣ Compile-Time Polymorphism Achieved using method overloading Same method name with different parameters Decided at compile time 2️⃣ Run-Time Polymorphism Achieved using method overriding Child class provides a specific implementation of a parent class method Decided at runtime 🔹 Why Polymorphism Is Important? Improves code flexibility Supports dynamic method behavior Reduces complexity Enhances code reusability Makes applications easier to extend 🌱 Reflection Learning polymorphism helped me understand how Java handles dynamic behavior in real-world applications. It showed me how one interface or method can support multiple implementations cleanly and efficiently. Feeling confident as I complete Day 30 of my Java learning journey! 🚀💪 🔖 #Day30 #Java #Polymorphism #OOPS #100DaysOfCode #LearningJourney #CodingLife #WomenInTech #JavaBasics #TechCareer #KeepGrowing
To view or add a comment, sign in
-
-
🚀 Day 13 | Core Java Learning Journey 📌 Topic: Inheritance in Java Today, I explored Inheritance, a fundamental pillar of Object-Oriented Programming in Java that promotes code reusability and logical hierarchy. 🔹 What is Inheritance? ✔️ Inheritance allows one class to acquire properties & behaviors of another class ✔️ Helps create parent-child relationships between classes ✔️ Achieved using the extends keyword 📌 Key Idea: Child Class → Reuses Parent Class features Example: class Animal { void eat() { System.out.println("Eating..."); } } class Dog extends Animal { void bark() { System.out.println("Barking..."); } } public class Main { public static void main(String[] args) { Dog d = new Dog(); d.eat(); // inherited method d.bark(); } } 🔹 Advantages of Inheritance ✔️ Code reusability ✔️ Reduces redundancy ✔️ Improves maintainability ✔️ Supports method overriding (runtime polymorphism) ✔️ Creates clear class hierarchy 🔹 Types of Inheritance in Java 1️⃣ Single Inheritance One child inherits one parent 2️⃣ Multilevel Inheritance Chain of inheritance (Parent → Child → Grandchild) 3️⃣ Hierarchical Inheritance Multiple children inherit the same parent 4️⃣ Hybrid Inheritance (via Interface) Combination of inheritance types using interfaces 5️⃣Multiple Inheritance (via Interface) Java classes don’t support multiple inheritance directly Achieved using interfaces 📌 Quick Summary ✔️ Inheritance = Reuse & Extension of existing code ✔️ Implemented using extends ✔️ Multiple inheritance possible via interfaces Special thanks to Vaibhav Barde Sir for making concepts simple and practical. Excited to keep learning and building 🚀💻 #CoreJava #JavaLearning #OOP #Inheritance #JavaDeveloper #LearningJourney
To view or add a comment, sign in
-
-
🚀 Day – Java Learning Update 🚀 Today, I learned Unary and Bitwise Operators in Java and practiced how they manipulate values at both logical and binary levels. 🔹 Unary Operators Unary operators work on a single operand. ✔ + → Unary plus (indicates positive value) ✔ - → Unary minus (negates value) ✔ ++ → Increment (increases value by 1) a++ (Post-increment) / ++a (Pre-increment) ✔ -- → Decrement (decreases value by 1) a-- (Post-decrement) / --a (Pre-decrement) Pre operators Value is incremented first, then used in the expression. Post operators Value is used first, then incremented. ✔ ! → Logical NOT (reverses boolean value) Syntax Example: int a = 10; a++; // Increment --a; // Decrement 🔹 Bitwise Operators Bitwise operators work on binary (bit-level) values. ✔ & → Bitwise AND ✔ | → Bitwise OR ✔ ^ → Bitwise XOR ✔ ~ → Bitwise Complement ✔ << → Left Shift ✔ >> → Right Shift Syntax Example: int x = 5; // 0101 int y = 3; // 0011 #Java #CoreJava #JavaFullStack #UnaryOperators #BitwiseOperators #HandsOnLearning #SoftwareDeveloper #LearningJourney 10000 Coders Meghana M
To view or add a comment, sign in
-
🚀 Learning Update: Sorting Custom Objects Using ArrayList in Java Today I worked on an interesting Java concept — sorting custom objects stored in an ArrayList. In real-world applications, we often deal with objects like Students, Employees, or Products instead of primitive data types. Learning how to sort these objects efficiently is an important skill for writing clean and scalable code. 🔹 What I learned: ✅ Creating a custom class with attributes ✅ Storing objects inside an ArrayList ✅ Sorting objects using Comparator with lambda expressions ✅ Writing cleaner and more readable Java code Here’s a simple example I practiced: 💡 Key takeaway: Java provides powerful tools like Comparator and lambda expressions that make sorting objects flexible and easy without modifying the original class. Every day learning something new and strengthening my Java fundamentals 💻✨ #Java #Programming #LearningJourney #SoftwareDevelopment #JavaDeveloper #Coding #Collections #OOP
To view or add a comment, sign in
-
-
🚀 Day 11 | Core Java Learning Journey 📌 Topic: Class & Object in Java Today, I explored one of the most fundamental concepts of Object-Oriented Programming — Classes and Objects. 🔹 What is a Class? ✔️ A class is a blueprint or template for creating objects ✔️ It is a logical entity (not a real-world object) ✔️ A class itself does not occupy memory ✔️ It defines properties (fields) and behaviors (methods) 🔹 What is an Object? ✔️ An object is an instance of a class ✔️ It represents a real-world entity ✔️ Objects occupy memory ✔️ Objects allow us to access class members 📌 Key Insight: Class → Definition / Blueprint Object → Actual usable entity 🔹 Simple Example in Java class Animal { String name; void eat() { System.out.println(name + " is eating"); } } public class Main { public static void main(String[] args) { Animal a1 = new Animal(); // Object Creation a1.name = "Dog"; // Assigning value a1.eat(); // Calling method } } 📌 Explanation: ✔️ Animal → Class (blueprint) ✔️ a1 → Object (instance of Animal) ✔️ new → Allocates memory & creates object ✔️ Object is used to access fields & methods Understanding this concept makes the foundation of OOP much clearer and stronger. Special thanks to Vaibhav Barde Sir for the clear and practical explanations. Excited to keep moving forward in my Java learning journey 💻✨ #CoreJava #JavaLearning #OOP #ClassAndObject #JavaDeveloper #LearningJourney
To view or add a comment, sign in
-
-
✨ Understanding Encapsulation in Java | TAP Academy As part of my Java learning journey, I explored Encapsulation, one of the core principles of Object-Oriented Programming (OOP). 🔐 What is Encapsulation? Encapsulation is the process of providing security to the components (variables) of an object and controlling access to them. It helps in: ✔ Protecting data ✔ Preventing unauthorized access ✔ Improving maintainability ✔ Increasing code flexibility 🔒 How is Security Provided? Security is achieved using the private access modifier. When we declare instance variables as private, they cannot be accessed directly from outside the class. 🎛 How is Control Access Provided? Control access is achieved using: ✅ Setter methods ✅ Getter methods ✏ Setter Method Used to set (initialize/update) data Always takes input parameters Always has void return type 📖 Getter Method Used to get (retrieve) data Does not take any input parameters Return type depends on the data type of the variable ⚠ Naming Convention & Shadowing Problem To follow proper encapsulation: Input parameter name is often kept same as instance variable name Example: private int age; public void setAge(int age) { age = age; // Naming clash (Shadowing Problem) } Here, the local variable shadows the instance variable. This is called the Shadowing Problem. ✅ Solution: Using this Keyword To resolve this issue, we use the this keyword. this refers to the currently executing object. public void setAge(int age) { this.age = age; // Correct way } this.age → refers to instance variable age → refers to method parameter Thus, this helps in clearly differentiating between instance variables and local variables. ✨ Conclusion Encapsulation ensures: Data Security Controlled Access Clean & Maintainable Code It is one of the strongest pillars of Object-Oriented Programming. #Java #OOPS #Encapsulation #Programming #LearningJourney #TAPAcademy 🚀
To view or add a comment, sign in
-
-
🚀 Day 7 | Core Java Learning Journey 📌 Topic: Arrays in Java Today, I learned about Arrays in Core Java, one of the most important data structures used to store multiple values efficiently using a single variable. 🔹 What is an Array? An array is a data structure that stores multiple values of the same data type in contiguous memory locations, allowing fast access using index values. 🔹 Advantages of Arrays ✅ Helps in code optimization by reducing multiple variable declarations ✅ Provides fast data access using index ✅ Improves performance due to contiguous memory allocation ✅ Useful for handling large amounts of similar data 🔹 Disadvantages of Arrays ❌ Fixed size (cannot be resized dynamically) ❌ Memory wastage if allocated size is not fully utilized ❌ Stores only homogeneous data ❌ Insertion and deletion operations are costly 🔹 Types of Arrays in Java 1️⃣ One-Dimensional Array Used to store elements in a linear form. Syntax : int a[ ] = new int[size]; 2️⃣ Two-Dimensional Array Stores data in rows and columns (matrix form). Syntax: int a[ ][ ] = new int[rows][columns]; 3️⃣ 3D Array Used to store data in three dimensions, useful for complex data representation. Syntax : int a[ ][ ][ ] = new int[x][y][z]; 4️⃣ Jagged Array An array of arrays where each row can have a different size. Syntax : int a[ ][ ] = new int[rows][ ]; 📌 Key Learning: Arrays help in writing cleaner, optimized, and efficient code and form the foundation of advanced data structures. A special thanks to Vaibhav Barde Sir for his clear explanations and consistent support throughout the learning process. Looking forward to learning more Core Java concepts ahead! 💻✨ #CoreJava #JavaDeveloper #BackendEngineering #SoftwareDeveloper #ComputerScienceGraduate #ProgrammingLife #TechLearning #JavaConcepts
To view or add a comment, sign in
-
-
🚀 Understanding the Rules of Inheritance & Constructor Chaining in Java | Core Java Learning As part of my continuous learning in Core Java, I explored some important rules of Inheritance and the difference between this() and super() in constructor chaining. Here are the key takeaways: 🔹 Important Rules in Inheritance ✅ 1. Private Members and Inheritance Private members of a class do not participate in inheritance. They are accessible only within the same class and cannot be directly accessed by the child class. ✅ 2. Constructors and Inheritance Constructors are not inherited by child classes. However, constructor chaining can be achieved using super() to initialize parent class members. ✅ 3. super() Call Rule The first line of every constructor implicitly or explicitly calls the parent class constructor using super(). If we do not write it manually, Java automatically inserts it. 🔹 Difference Between this() and super() this()super()Used to achieve constructor chaining within the same classUsed to achieve constructor chaining between parent and child classMust be written manually by the programmerAdded by Java by default (if not written explicitly)Refers to current class constructorRefers to immediate parent class constructor ⚠️ Important Rule ❗ this() and super() cannot be used together in the same constructor. Because both must be written as the first statement in the constructor. Understanding these concepts helped me strengthen my foundation in Object-Oriented Programming (OOPS) and how Java manages object initialization efficiently. Every small concept builds strong fundamentals 💡 #Java #CoreJava #OOPS #Inheritance #ConstructorChaining #Programming #LearningJourney TAP Academy
To view or add a comment, sign in
-
-
🚀 Java Learning Series — Day 10/100 📘 Relational & Logical Operators in Java Today I learned about Relational and Logical operators, which are essential for comparison, validation, and decision-making in Java applications. 🔹 Relational Operators Used to compare values and return a boolean result. == → Checks whether two values are equal != → Checks whether two values are different > → Verifies if the left value is greater than the right < → Verifies if the left value is smaller than the right >= → Checks if a value meets or exceeds a limit <= → Checks if a value is within an allowed range 🔹 Logical Operators Used to combine multiple conditions. && (AND) → True only when all conditions are true || (OR) → True when at least one condition is true ! (NOT) → Reverses the result of a condition 🔐 Real-Time Example: Login Validation 💡 Idea Behind the Example This program simulates a real-world login system where access is granted only when: Username matches Password matches User age is 18 or above Relational operators are used to compare values, while logical operators combine all login rules into a single boolean expression. The final result is stored in a boolean variable, which determines whether the login is successful or failed — without using conditional statements. 📸 (Code image attached below) ✨ Key Takeaways Relational operators handle value comparison Logical operators connect multiple validation rules Boolean expressions can decide outcomes efficiently Widely used in authentication and form validation systems 📌 Day 10 completed successfully! #Java #CoreJava #JavaDeveloper #BackendDevelopment #BackendDeveloper #SoftwareDevelopment #Programming #Coding #CleanCode #Authentication #SystemDesignBasics #ProblemSolving #DeveloperJourney #LearningInPublic #100DaysOfJava # Meghana M # 10000 Coders
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