
Flashcard on OOPs Concepts
Flashcard
•
Computers
•
University
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

28 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What will be the output of the following code?
interface A {
void method();
}
abstract class B implements A {
public void method() {
System.out.println("Class B");
}
}
class C extends B {
}
public class Main {
public static void main(String[] args) {
C obj = new C();
obj.method();
}
}
Back
Class B
2.
FLASHCARD QUESTION
Front
What will be the output of the following code?
abstract class Animal { abstract void makeSound(); static void sleep() { System.out.println("Sleeping..."); } } class Dog extends Animal { void makeSound() { System.out.println("Bark"); } } public class Main { public static void main(String[] args) { Dog d = new Dog(); d.makeSound(); Animal.sleep(); } }
Back
Bark Sleeping...
3.
FLASHCARD QUESTION
Front
What will happen when the following code is executed?
interface A {
static void display() {
System.out.println("Interface A");
}
}
class B implements A {}
public class Main {
public static void main(String[] args) {
B obj = new B();
obj.display();
}
}
Options: A) Interface A, B) Compilation error, C) Runtime error, D) None of the above
Back
Compilation error
4.
FLASHCARD QUESTION
Front
What will be the output of the following code?
abstract class A { A() { System.out.println("Abstract class A constructor"); } } class B extends A { B() { System.out.println("Subclass B constructor"); } } public class Main { public static void main(String[] args) { B obj = new B(); } }
Back
Abstract class A constructor
Subclass B constructor
5.
FLASHCARD QUESTION
Front
Which of the following statements about abstract classes is FALSE?
Options: A) An abstract class can have final methods, B) An abstract class can implement an interface
, C) An abstract class cannot have a constructor
, D) An abstract class can have static methods
Back
An abstract class cannot have a constructor
6.
FLASHCARD QUESTION
Front
What is the correct way to define multiple interface implementations?
Options: A) class A extends B, C {}, B) class A implements B, C {}
, C) class A implements B extends C {}
, D) class A implements B & C {}
Back
class A implements B, C {}
7.
FLASHCARD QUESTION
Front
If a class implements multiple interfaces with methods having the same signature, what happens?
Back
The class must provide a single implementation for the method.
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
15 questions
Put the word or phrase in the right place in the question
Flashcard
•
KG - University
21 questions
Chinese Traditional Thoughts
Flashcard
•
University
24 questions
Jackeline 03/02/2025
Flashcard
•
KG - University
20 questions
AP CSA unit 1 review
Flashcard
•
11th Grade - University
23 questions
2024/25 Chapter 10 - Choosing a President Review
Flashcard
•
12th Grade
18 questions
Federalism
Flashcard
•
12th Grade
15 questions
Complete Ielts 5-6.5 - Unit 6 (Listening & Reading_Vocab))
Flashcard
•
University
15 questions
Curriculum Approaches Flashcards
Flashcard
•
University
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
9 questions
Principles of the United States Constitution
Interactive video
•
University
18 questions
Realidades 2 2A reflexivos
Quiz
•
7th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
25 questions
Integer Operations
Quiz
•
KG - University
7 questions
What Is Narrative Writing?
Interactive video
•
4th Grade - University
20 questions
SER vs ESTAR
Quiz
•
7th Grade - University