
Quiz4

Quiz
•
Computers
•
University
•
Medium
Ms. Asst.Prof
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of this keyword must be used to inherit a class?
super
this
extent
extends
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these is correct way of inheriting class A by class B?
class B + class A {}
class B inherits class A {}
class B extends A {}
class B extends class A {}
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java program?
class A
{
int i;
void display()
{
System.out.println(i);
}
}
class B extends A
{
int j;
void display()
{
System.out.println(j);
}
}
class inheritance_demo
{
public static void main(String args[])
{
B obj = new B();
obj.i=1;
obj.j=2;
obj.display();
}
}
0
1
2
Compilation Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java program?
class A
{
int i;
}
class B extends A
{
int j;
void display()
{
super.i = j + 1;
System.out.println(j + " " + i);
}
}
class inheritance
{
public static void main(String args[])
{
B obj = new B();
obj.i=1;
obj.j=2;
obj.display();
}
}
2 2
3 3
2 3
3 2
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
____________ can be defined as the process where one class acquires the properties (methods and fields) of another.
Overriding
Polymorphism
Inheritance
Abstraction
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The class which inherits the properties of other is known as ________
superclass
subclass
parent class
None of the above
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Subclass also known as ?
derived class
child class
base class
Both A and B
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Briefing Operator Java

Quiz
•
University
10 questions
Electriva Quimica - Modulo 1

Quiz
•
University
10 questions
Pemrograman Berorientasi Objek

Quiz
•
10th Grade - University
10 questions
Java Quiz 1

Quiz
•
University
10 questions
Introduction to Java

Quiz
•
University
10 questions
CMP128 Java Ch. 05 Methods

Quiz
•
University
12 questions
Java

Quiz
•
11th Grade - University
10 questions
Java - Introduction

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University