ECET 2026 Preparation

Day 4 Night Blog: Java Programming – OOPs Concepts | ECET CSE 2026

Concept Notes: Java OOPs Concepts

🔹 1. What is OOP?

Object-Oriented Programming (OOP) is a method of structuring code around objects instead of functions.

🔹 2. 4 Pillars of OOP in Java

ConceptMeaning
EncapsulationWrapping data & methods into a single unit (class)
InheritanceOne class inherits properties of another (extends)
PolymorphismOne task done in multiple ways (method overloading/overriding)
AbstractionHiding internal details, showing only essentials (via abstract class)

🔹 3. Key Java OOP Terms

  • Class: Blueprint for an object
  • Object: Instance of a class
  • Constructor: Special method to initialize objects
  • Method Overloading: Same method name, different parameters
  • Method Overriding: Same method in child class changes parent class method

🔹 4. Sample Code

class Animal {
  void sound() {
    System.out.println("Animal sound");
  }
}

class Dog extends Animal {
  void sound() {
    System.out.println("Bark");
  }
}

Java OOPs MCQs – Day 4 Night

1️⃣ What is encapsulation in Java?
A) Hiding data
B) Inheriting class
C) Overloading methods
D) Multiple inheritance

2️⃣ Which keyword is used for inheritance in Java?
A) inherit
B) derive
C) extend
D) implements

3️⃣ What is the output of method overriding?
A) Parent method runs
B) Child method replaces parent
C) Compile-time error
D) Method is skipped

4️⃣ Which is not part of OOPs in Java?
A) Inheritance
B) Polymorphism
C) Encapsulation
D) Compilation

5️⃣ What is a class in Java?
A) Runtime instance
B) Collection of statements
C) Blueprint for objects
D) A memory location

6️⃣ What is constructor used for?
A) Destroying object
B) Initializing object
C) Accessing methods
D) Overriding class

7️⃣ What is method overloading?
A) Same method name, same parameters
B) Same method name, different parameters
C) Same method body
D) No return type

8️⃣ What does super keyword do?
A) Creates class
B) Refers to parent class
C) Creates object
D) Calls main()

9️⃣ Which concept allows same method to behave differently?
A) Inheritance
B) Polymorphism
C) Encapsulation
D) Data hiding

🔟 Which OOP principle shows only essential info?
A) Abstraction
B) Inheritance
C) Encapsulation
D) Polymorphism

✅ Answer Key

Q.NoAnswer
1A
2C
3B
4D
5C
6B
7B
8B
9B
10A

🧠 Explanations

  • Q1: Encapsulation wraps data and code together.
  • Q2: extends is the Java keyword for inheritance.
  • Q3: Overriding allows child method to replace parent’s.
  • Q4: Compilation is a general concept, not OOP-specific.
  • Q5: Class is a blueprint/template for objects.
  • Q6: Constructor initializes new objects.
  • Q7: Overloading = same name, different params.
  • Q8: super accesses parent class methods.
  • Q9: Polymorphism means many forms (overload/override).
  • Q10: Abstraction hides unnecessary implementation details.

📥 PDF Available

Join Telegram group and get all notes, MCQs, and explanations as downloadable PDFs 👇
👉 @learnnewthingsoffcial

💬 Comment Task

🗣 Which OOPs concept do you find toughest – Overloading, Inheritance, or Abstraction?
Let us know, and we’ll post a mini YouTube Short tomorrow 🔥

Loading

Leave a comment

Your email address will not be published. Required fields are marked *