
Mastering Java OOP Concepts

Quiz
•
Computers
•
University
•
Easy
SHOBHANJALY CSE
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the four main principles of Object-Oriented Programming?
Inheritance, Overloading, Recursion, Serialization
Composition, Aggregation, Delegation, Interface
Encapsulation, Modularity, Scripting, Data Structures
Encapsulation, Abstraction, Inheritance, Polymorphism
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Define encapsulation and provide an example in Java.
class Person { private String name; public String getName() { return null; } }
class Person { private String name; public void displayName() { System.out.println(name); } }
class Person { public String name; }
Example in Java: class Person { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } }
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is inheritance and how is it implemented in Java?
Inheritance in Java allows a class to inherit fields and methods from another class using the 'extends' keyword.
Inheritance allows a class to inherit only methods, not fields.
Inheritance in Java is a way to create multiple classes from a single class without any relationship.
Inheritance in Java is implemented using the 'implements' keyword.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain polymorphism and its types in Java.
There are three types of polymorphism in Java: static, dynamic, and abstract.
Polymorphism refers to the ability of a class to have multiple constructors.
Polymorphism in Java has two types: Compile-time polymorphism (method overloading) and Runtime polymorphism (method overriding).
Polymorphism in Java is only related to class inheritance.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is an interface in Java and how does it differ from an abstract class?
An interface is a type of class that cannot be instantiated, while an abstract class can be instantiated.
An interface can only contain concrete methods, while an abstract class can have abstract methods only.
An interface in Java is a contract that classes can implement, while an abstract class can provide some implementation and state.
An interface can have instance variables, while an abstract class cannot.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Describe the concept of method overloading in Java.
Method overloading is the ability to override methods in a subclass.
Method overloading is the ability to define multiple methods in the same class with the same name but different parameter lists.
Method overloading allows methods to have different names in the same class.
Method overloading is when a method can only have one parameter.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the 'super' keyword in Java?
The 'super' keyword is used to access superclass methods and constructors.
The 'super' keyword is used to define interfaces.
The 'super' keyword is used to declare variables.
The 'super' keyword is used to create new classes.
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Object Oriented Programming Assessment 1

Quiz
•
University
9 questions
Object Oriented Programming

Quiz
•
University
13 questions
Java Basics for Grade 13 Students

Quiz
•
University
10 questions
STM 20483 QUIZ 1

Quiz
•
University
10 questions
Java quiz 1

Quiz
•
University
10 questions
Latihan1

Quiz
•
University
15 questions
C++ Quiz-1

Quiz
•
University
10 questions
Quiz on OOPs- Day 1 (30-01-2025)

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th 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
36 questions
Unit 5 Key Terms

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

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University