
Spring Semester Quiz 6
Authored by Ashong Nartey
Other
University
Used 7+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
e-Quiz (Day 4)
Quiz
•
University
10 questions
TOPIC 1 - INTRODUCTION TO BUSINESS ETHICS
Quiz
•
University
16 questions
Warm up
Quiz
•
University
15 questions
Financial Services
Quiz
•
University
10 questions
Week 7 - Weekly Participation Activity
Quiz
•
University
10 questions
Radio Transmitters
Quiz
•
1st Grade - University
10 questions
Superstar Goes to SMAK Thomas Aquino
Quiz
•
University
10 questions
Dimensi Smart City Quiz
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Other
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
20 questions
Endocrine System
Quiz
•
University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
30 questions
W25: PSYCH 250 - Exam 2 Practice
Quiz
•
University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
38 questions
Unit 8 Review - Absolutism & Revolution
Quiz
•
10th Grade - University