
Spring Semester Quiz 6

Quiz
•
Other
•
University
•
Easy

Ashong Nartey
Used 7+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What will be the output of the following code?
class A {
void display() {
System.out.println("Class A");
}
}
class B extends A {
void display() {
System.out.println("Class B");
}
}
public class Main {
public static void main(String[] args) {
A obj = new B();
obj.display();
}
}
Class A
Class B
Compilation Error
Runtime Error
2.
MULTIPLE SELECT QUESTION
20 sec • 3 pts
Which of the following statements about the Object class in Java is/are FALSE?
Every Java class extends Object class either directly or indirectly.
Only classes without a superclass extend Object class.
The Object class cannot be extended.
Object class is an abstract class.
3.
MULTIPLE SELECT QUESTION
20 sec • 3 pts
The following are not among the primary purposes of encapsulation in Java?
To restrict access to data and ensure data hiding.
To group related methods together.
To implement multiple inheritance.
To allow direct access to class fields.
4.
FILL IN THE BLANK QUESTION
20 sec • 1 pt
Which keyword is used to refer to the immediate parent class in Java?
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What happens if an abstract class does not have any abstract methods?
Java will automatically provide an abstract method.
It will not compile.
The class can still be abstract.
It becomes a concrete class.
6.
FILL IN THE BLANK QUESTION
20 sec • 1 pt
What will be the output of this code?
class Animal {
void makeSound() {
System.out.println("Animal makes a sound");
}
}
class Dog extends Animal {
void makeSound() {
System.out.println("Dog barks");
}
}
public class Main {
public static void main(String[] args) {
Animal a = new Dog();
a.makeSound();
}
}
7.
MULTIPLE SELECT QUESTION
20 sec • 3 pts
Which of the following statements about abstract classes is/are FALSE?
Abstract classes cannot have constructors.
Abstract classes cannot have final methods.
An object of an abstract class cannot be instantiated.
Abstract classes cannot have static methods.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Contract Act

Quiz
•
University - Professi...
20 questions
Contracts

Quiz
•
KG - University
10 questions
BUSINESS LAW- CHAPTER 2

Quiz
•
University
20 questions
Unit 2: Contracts (Vitiating, Termination of Offer & Contract)

Quiz
•
University
11 questions
trever henderson

Quiz
•
12th Grade - University
10 questions
Java Programming MCQ Questions

Quiz
•
University
17 questions
Singly and Doubly Linked List Quiz

Quiz
•
University
20 questions
Techwiz - ICL2.0 Quiz

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 Other
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