java quiz on Encapsulation and Abstraction

Quiz
•
Computers
•
University
•
Medium
shruti keshari
Used 226+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which among the following best describes encapsulation?
It is a way of combining various data members into a single unit
It is a way of combining various member functions into a single unit
It is a way of combining various data members and member functions into a single unit which can operate on any data
It is a way of combining various data members and member functions that operate on those data members into a single unit
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If data members are private, what can we do to access them from the class object?
Create public member functions to access those data members
Create private member functions to access those data members
Create protected member functions to access those data members
Private data members can never be accessed from outside the class
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which feature can be implemented using encapsulation?
Inheritance
Abstraction
Polymorphism
Overloading
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which inheritance in java programming is not supported
Multiple inheritance
hierarchal inheritance
Multilevel inheritance
Single inheritance
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is subclass in java?
A subclass is a class that extends another class
A subclass is a class declared inside a class
Both above.
None of the above.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If class B is subclassed from class A then which is the correct syntax
class B:A{}
class B extends A{}
class B extends class A{}
class B implements A{}
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Find which of the following uses encapsulation?
void main(){
int a;
void fun() { int a=10;
System.out.println(a);
fun(); }
class student{
int a;
public int b; };
class student {
int a;
public void disp(){
System.out.println(a);
} }
static topper() {
char name[10];
public int marks; }
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Software Design Basics

Quiz
•
University
10 questions
Java Static

Quiz
•
University
10 questions
System Analysis and Design part 1

Quiz
•
University
12 questions
PRG1 - Tuesday week 2 - starter

Quiz
•
University
15 questions
Week 09 - Mastering OOP Concepts in C++

Quiz
•
University
8 questions
Business Analysis 2 - Data modelling and requirements

Quiz
•
University
10 questions
Session 6 | U

Quiz
•
University
10 questions
Inheritance

Quiz
•
University
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
11 questions
NFL Football logos

Quiz
•
KG - Professional Dev...
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
38 questions
Unit 6 Key Terms

Quiz
•
11th Grade - University
20 questions
La Hora

Quiz
•
9th Grade - University
7 questions
Cell Transport

Interactive video
•
11th Grade - University
7 questions
What Is Narrative Writing?

Interactive video
•
4th Grade - University