OOP- PROGRAMMING.
Trusted by students across multiple disciplines!
What is Inheritance? - Answer: Inheritance is a mechanism in which one object
acquires all the properties and behavior of another object of another class. It represents
IS-A relationship. It is used for Code Reusability.
What is Abstraction? - Answer: Abstraction is a process of hiding the implementation
details and showing only functionality to the user. Abstraction lets you focus on what the
object does instead of how it does it.
What is Encapsulation? - Answer: Encapsulation is the combining of data and code into
a single object.
What is Polymorphism? - Answer: When two different objects respond to the exact
same message in different ways. Meaning objects can take on many forms.
What is method overloading? - Answer: It occurs when two or more methods in the
same class have the exact same name but:
1) The number of parameters is different for the methods. (2 parameters vs 3
parameters)
2) The parameter types are different from the previous method. (2 ints vs 2 doubles)
What is method overriding? - Answer: It is a feature that allows subclasses to provide
their own implementation of a method that is already defined in the main class. This
overrides the implementation in the superclass by providing the same method name,
same parameter and same return type.
Abstract Class vs Interface - Answer: -An interface is not a class.
1
APPHIA - Crafted with Care and Precision for Academic Excellence.