← All AMCAT Flashcard Decks

Object-Oriented Programming Concepts Flashcards

7 cards from real AMCAT practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Object-Oriented Programming Concepts flashcards as text
  1. Method overriding in OOP occurs when:

    Answer: A subclass defines a method with the same name and signature as a method in its superclass

    Method overriding (runtime polymorphism) allows a subclass to provide its own specific implementation of a method already defined in its superclass.

  2. What is the primary purpose of a constructor in a class?

    Answer: To initialize an object's state when it is created

    A constructor is a special method invoked automatically when an object is instantiated, used to set the initial state (field values) of the object.

  3. What does the keyword 'this' refer to inside an instance method?

    Answer: The current instance of the class

    'this' is a reference to the current object — the instance on which the method is being called — and is commonly used to resolve naming conflicts between instance variables and parameters.

  4. Which access modifier makes a class member accessible only within the class in which it is declared?

    Answer: private

    The private access modifier restricts visibility to the enclosing class only, supporting encapsulation by hiding implementation details.

  5. What is a static method in OOP?

    Answer: A method that belongs to the class itself rather than any instance

    Static methods belong to the class rather than to any particular object instance, and are called on the class directly (e.g., ClassName.method()).

  6. In Java, which keyword is used to call the parent class's constructor from a subclass?

    Answer: super()

    super() calls the parent class's constructor, and it must be the first statement in the subclass constructor when used.

  7. Which of the following OOP concepts allows hiding complex implementation details and showing only the essential features?

    Answer: Abstraction

    Abstraction focuses on exposing only the necessary interface to the user while hiding the underlying complexity, achieved through abstract classes and interfaces.