![placeholder image to represent content](/_next/image?url=%2Fassets%2Fquiz_default_logo.jpg&w=256&q=75)
Chapter 2 : Inheritance and Polymorphism
Quiz by Ainin Sofiya Hisham
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
- Q1
What is inheritance?
It is the process where one object acquires the properties of another.
All answer are TRUE
inheritance is the ability of an object to take on many forms.
inheritance is a technique to define different methods of same type.
30s - Q2
There were 4 protected members or access modifiers. What are they ? You may select one or more
No keyword or default
Private
All answers are TRUEProtected
Public
30s - Q3
Create an object of MyVehicle called myCar.
Users enter free textType an Answer30s - Q4
Private access modifier are visible to the class only
truefalseTrue or False30s - Q5
Public access modifier are visible to the certain classes only
falsetrueTrue or False30s - Q6
Protected are visible to the package and all subclasses.
truefalseTrue or False30s - Q7
An accessor method is used to __________ the value of a ________ field.
Type-in the correct format (xxxx, xxxx). space after comma
Users enter free textType an Answer30s - Q8
GUI stands for ______________.
Users enter free textType an Answer30s - Q9
In chain of inheritance, we need to have a ________ which is to extend, or inherit from, a class.
superclass
subclass
30s - Q10
public class Main {
int x = '5';
}
QUESTION : CAN YOU GAIN OUTPUT FROM THIS CODE STRUCTURE
falsetrueTrue or False30s - Q11
What is meant by instantiated in abstract classes?
creating an object of the main method
creating an variable of the class
creating an object of the class
creating an object of the subclass
30s - Q12
Two types of polymorphism :
Compile time polymorphismRuntime polymorphismExtend time polymorphism
Walktime polymorphism
30s - Q13
Compile time polymorphism is _________
static binding
dinasour binding
state binding
dynamic binding
30s - Q14
Runtime polymorphism is a _________
dynamic binding
static binding
dinasour binding
state binding
30s - Q15
public class MyVehicle {
public static void main(String[] args)
{ _______._______.______.("Bai DSET2. See you next week. Happy mengundi !! ");}
}
put your answer in separated dot (xxxx.yyyy.zzzz)
System.out.println
30s