EXAM QUESTIONS WITH CORRECT ANSWERS
◉ Method Overriding. Answer: When a child class overwrites a method
inherited from a parent class.
◉ Method Overloading. Answer: When two methods have the same
name, but different parameters.
◉ Inheritance. Answer: is a mechanism in which one object acquires all
the properties and behaviors of a parent object. It is an important part of
OOPs (Object Oriented programming system).
◉ Encapsulation. Answer: is a process of wrapping code and data
together into a single unit, for example, a capsule which is mixed of
several medicines. Using a getter and setter.
◉ Abstraction. Answer: is a process of hiding the implementation details
and showing only functionality to the user.
◉ Generalization. Answer: is the process of extracting shared
characteristics from two or more classes, and combining them into a
, generalized superclass. Shared characteristics can be attributes,
associations, or methods.
◉ Specialization. Answer: means creating new subclasses from an
existing class. If it turns out that certain attributes, associations, or
methods only apply to some of the objects of the class, a subclass can be
created.
◉ Constructor. Answer: is a block of codes similar to the method. It is
called when an instance of the object is created, and memory is allocated
for the object.
It is a special type of method which is used to initialize the object.
◉ Switch. Answer: allows a variable to be tested for equality against a
list of values.
◉ Loop. Answer: A statement that allows us to execute a statement or
group of statements multiple times and following is the general form of
a loop statement in most of the programming languages.
◉ 4 Pillars OOP. Answer: Inheritance, polymorphism, encapsulation,
and abstraction.
◉ Types of loops. Answer: While , for, do..while