You are on page 1of 5

G7 Third Term Reviewer

● Polymorphism is used in programs for the code’s reusability.


● Polymorphism are different actions that can be performed at the same time.
● The other name for a public method in JAVA is also known as non-static
● Java Inheritance can also be seen inside polymorphism.
● An object oriented programming that has a multi sub-classes to create multiple forms of
just one method or subject is polymorphism.
● Base class is also known as superclass.
● Inheritance is used to reuse a code in a new class from an existing class.
● The OOP concept that is used to hide important information is called encapsulation.
● “Private” is an access modifier to set an attribute to be used in encapsulation.
● Write-only for setter, Read-only for getter.
● “Public” is an attribute accessible to all classes.
● Constructor is called when an object is created.
● Non-access modifiers are used for additional functionalities to the methods, variables
and classes such as static.
● The special method used to set values to attributes is called constructor.
● Animal camel = new Animal(); is one example of correct syntax when creating an object.
● Dot syntax is used to access attributes when an object is involved.

GETTER/SETTER
1. Reusing an existing class in a new class to be able to perform an action in different
ways.
2. A concept that is used to form another concept.
3. An attribute is set to this access modifier for it to be hidden.
4. A method is used to change the value of a private attribute.
5. A method is used to access the value of a private attribute.
Study the given sample codes and Identify if it’s Encapsulation, Inheritance or
Polymorphism.

6.

7.
8.

9.
10.

11.

12.
13.

● What action do both of the classes named "Animal" and "Human" can do based on the
code?
● What are the actions the class named "Human" can do based on the code? Type the
sentences that will be printed out if these actions are called.
● What type of inheritance is used in this example?
● What are the super classes in this example?
● What are the subclasses in this example?
● how the access modifiers work in JAVA by comparing it in a real-life situation.
● Why is polymorphism used in JAVA OOP?

You might also like