Another key idea in object oriented programming is abstraction. Abstraction focuses on exposing only the essential behaviour of an object while hiding the internal implementation details. In Java, one way to achieve abstraction is through abstract classes. Things that became clear : • an abstract class cannot be instantiated directly • abstract classes can contain both abstract methods and normal methods • abstract methods declare behaviour but do not provide implementation • child classes must provide implementation for the abstract methods • this allows a common structure while letting subclasses define specific behaviour A simple example helps illustrate the idea : abstract class Bird { abstract void fly(); } class Sparrow extends Bird { void fly() { System.out.println("Sparrow flying"); } } Here the Bird class defines the idea of flying, but the actual behaviour is implemented by the specific type of bird. This approach helps separate what an object does from how it actually performs the task. #java #oop #programming #learning #dsajourney
Lakhyadeep Sen’s Post
More Relevant Posts
-
🚀 Learning OOP Concept: Polymorphism in Java Today, I explored one of the core concepts of Object-Oriented Programming — Polymorphism. 🔹 What is Polymorphism? Polymorphism means “one object, many forms.” It allows methods to perform different tasks based on the object that is calling them. 🔹 Types of Polymorphism: 1. Compile-time (Method Overloading) Same method name, different parameters. 2. Runtime (Method Overriding) Same method name, same parameters, but different implementation in child classes. 🔹 Why is it important? ✔ Improves code flexibility ✔ Enhances reusability ✔ Supports dynamic behavior in applications 🔹 Simple Example: A method "draw()" can behave differently for shapes like Circle, Square, and Triangle. 💡 This concept plays a major role in writing scalable and maintainable applications. Excited to keep learning and building more with Java! ☕ #Java #OOP #Polymorphism #Programming #LearningJourney #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Learning Java OOP Through Projects To strengthen my understanding of Object-Oriented Programming in Java, I built several mini projects where I focused on applying the core OOP principles in practice. Through these projects, I explored and implemented the following key concepts: 🔹 Classes & Objects 🔹 Encapsulation 🔹 Inheritance 🔹 Polymorphism 🔹 Abstraction 🔹 Collections (ArrayList) Projects I built while learning these concepts: 🔹 Parking Lot System https://lnkd.in/gYX7x_qN 🔹 Quiz Game https://lnkd.in/gseXZdmt 🔹 Employee Salary Calculator https://lnkd.in/gb_yrQiQ 🔹 Memory Matching Game ( Swing) https://lnkd.in/gqxftHhb Building these projects helped me move beyond theory and understand how OOP concepts are applied in real programs. #Java #OOP #JavaProjects #Programming #LearningByDoing
To view or add a comment, sign in
-
Completed the object oriented programming section in Java. At the beginning it felt like a collection of separate topics, but while going through the concepts step by step it became clearer how everything connects. Things that stood out while learning this section : - classes and objects form the basic structure of object oriented programs - variables, constructors, and access modifiers help control how objects are created and how data is accessed - encapsulation protects internal data and allows controlled interaction - inheritance allows classes to reuse behaviour instead of rewriting logic - polymorphism makes programs more flexible by allowing the same operation to behave in different ways - abstraction helps focus on what an object does rather than how it does it One noticeable shift was moving from thinking about programs as a sequence of steps to thinking about them as groups of interacting objects. The concepts are simple individually, but together they create a much more organized way of designing programs. #java #oop #programming #learning #dsajourney
To view or add a comment, sign in
-
🚀 Day 16/45 – Understanding Abstraction in Java On Day 16 of my Java learning journey, I explored Abstraction, one of the core principles of Object-Oriented Programming. Abstraction focuses on hiding implementation details and showing only the essential functionality to the user. 📚 What I Learned Today Today I learned: ✔ What abstraction is and why it is important ✔ How to use abstract classes in Java ✔ Understanding abstract methods (methods without body) ✔ How abstraction works with inheritance 💻 Practice Work To apply my learning, I implemented: • An animal example using abstract class • A shape example demonstrating abstraction 🎯 Key Takeaway Abstraction helps simplify complex systems by hiding unnecessary details and focusing on what is important. It plays a key role in building clean and scalable applications. Step by step, I am gaining a deeper understanding of OOP concepts. #Java #Programming #LearningInPublic #CodingJourney #SoftwareDevelopment #OOP
To view or add a comment, sign in
-
🚀 Understanding Object-Oriented Programming (OOP) Basics Object-Oriented Programming is one of the most important concepts in modern software development. Here’s a simple breakdown: 🔹 Class – A blueprint or template used to create objects. 🔹 Object – A real-world instance of a class. 🔹 Field / Property (Data) – The attributes that define the state of an object. 🔹 Method (Behavior / Action) – The functions that define what an object can do. OOP helps in writing clean, reusable, and organized code. Mastering these fundamentals builds a strong foundation for languages like Java, C++, Python, and more. 💡 Keep learning. Keep building. #ObjectOrientedProgramming #OOP #Java #Programming #SoftwareDevelopment
To view or add a comment, sign in
-
-
Inheritance is one of the core ideas in object oriented programming that allows a class to reuse the properties and behaviour of another class. Instead of rewriting the same logic again, a new class can extend an existing one. Things that became clear : • inheritance allows one class to acquire the properties and methods of another class • the class that provides the features is called the parent or base class • the class that inherits those features is called the child or derived class • the extends keyword is used to create this relationship in Java • it helps promote code reuse and cleaner program structure A simple example helps illustrate the idea : class Person { String name; int age; } class Student extends Person { int marks; } In this case the Student class automatically gets the name and age properties from the Person class while also adding its own data. This structure helps avoid repeating code and keeps related behaviour organized through class relationships. #java #oop #programming #learning #dsajourney
To view or add a comment, sign in
-
Day 12 of Learning Java Understanding the 4 Pillars of OOP (Object-Oriented Programming Today I learned about the four main pillars of Object-Oriented Programming (OOP) in Java. These concepts help us write clean, secure, and reusable code. The four pillars are: 1️⃣ Encapsulation Encapsulation means binding data and methods together in one class. It also helps to protect data by using private variables and public methods. Example idea: A capsule contains medicine inside. Similarly, a class keeps data and methods together. 2️⃣ Inheritance Inheritance means one class can use properties and methods of another class. It helps in code reuse. Example: A Car class can inherit features from a Vehicle class. 3️⃣ Polymorphism Polymorphism means one thing, many forms. The same method can behave differently in different situations. Example: A method named add() can add two numbers or three numbers. 4️⃣ Abstraction Abstraction means showing only important details and hiding complex implementation. Example: When we drive a car, we only use the steering wheel and pedals. We do not need to know how the engine works internally. In Simple Words OOP Pillars help us: ✔ Organize code ✔ Reuse code ✔ Improve security ✔ Reduce complexity #Java #OOP #ObjectOrientedProgramming #LearningInPublic #CodingJourney #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Day 5/45 – Mastering Loops in Java On Day 5 of my Java learning journey, I explored one of the most important concepts in programming — Loops. Loops allow us to execute a block of code multiple times, which is essential for solving real-world problems efficiently. 📚 What I Learned Today Today I learned about: ✔ for loop for controlled iterations ✔ while loop for condition-based execution ✔ do-while loop which executes at least once These concepts helped me understand how repetition works in programming. 💻 Practice Work To apply my learning, I implemented: • Printing numbers from 1 to 10 • Calculating the sum of first 10 numbers • Generating multiplication tables • Creating star patterns using nested loops 🎯 Key Takeaway Loops are extremely powerful and help reduce repetitive code. Understanding loops is essential for solving complex problems and building efficient programs. Daily practice is helping me improve my logical thinking. #Java #Programming #LearningInPublic #CodingJourney #SoftwareDevelopment #Consistency
To view or add a comment, sign in
-
🚀 Day 15/45 – Understanding Polymorphism in Java On Day 15 of my Java learning journey, I explored Polymorphism, one of the key pillars of Object-Oriented Programming. Polymorphism allows the same method to behave differently based on the context, making code more flexible and reusable. 📚 What I Learned Today Today I learned: ✔ What polymorphism is and why it is important ✔ Method overloading (compile-time polymorphism) ✔ Method overriding (runtime polymorphism) ✔ Difference between overloading and overriding 💻 Practice Work To apply my learning, I implemented: • A method overloading example using different parameters • A method overriding example using inheritance 🎯 Key Takeaway Polymorphism improves code flexibility and helps in designing scalable applications. It allows developers to use a single interface with multiple implementations. Understanding these OOP concepts step by step is strengthening my programming foundation. #Java #Programming #LearningInPublic #CodingJourney #SoftwareDevelopment #OOP
To view or add a comment, sign in
-
Abstraction in Java The last OOP concept — Abstraction - using abstract classes. Here’s what I learned: 🔹 Abstract Methods These methods contain only the method signature (no body) and must be implemented by the child class. 🔹 Abstract Class Rules ✔ If a class contains abstract methods, it must be declared as abstract ✔ If a class extends an abstract class, it must either: • Implement all abstract methods, or • Be declared as abstract 🔹 Key Characteristics ✔ Abstract classes cannot be instantiated (no object creation) ✔ They can contain both abstract and non-abstract methods ✔ They behave like normal classes except for object creation 🔹 Constructor Behavior Even though we cannot create objects of an abstract class, its constructor is still executed when a child class object is created (via super()). This helped me clearly understand how abstraction provides structure and enforces implementation, making code more organized and scalable. TAP Academy #Java #OOP #Abstraction #Programming #SoftwareDevelopment #LearningJourney
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