Encapsulation & access Modifiers

Encapsulation & access Modifiers

University

7 Qs

quiz-placeholder

Similar activities

Java Class vocabulary

Java Class vocabulary

9th Grade - University

12 Qs

COMPUTER PROGRAMMING 2- SEATWORK 2- INTRO TO OBJECT OOP

COMPUTER PROGRAMMING 2- SEATWORK 2- INTRO TO OBJECT OOP

University

10 Qs

ADPROG1

ADPROG1

University

10 Qs

Dr. S. Uma's Object Oriented Programming Quiz Event 1

Dr. S. Uma's Object Oriented Programming Quiz Event 1

University

10 Qs

Java Quiz1

Java Quiz1

University

10 Qs

Java Juggling

Java Juggling

University

10 Qs

MS Core Java Quiz-2 2023

MS Core Java Quiz-2 2023

University

12 Qs

Java quiz-2024-Sec-B

Java quiz-2024-Sec-B

University

12 Qs

Encapsulation & access Modifiers

Encapsulation & access Modifiers

Assessment

Quiz

Computers

University

Medium

Created by

Archana Pasalkar

Used 1+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can Encapsulation be achieved?

Using Access Specifiers

Using only private members

Using inheritance

Using Abstraction

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Using encapsulation data security is ___________

Not ensured

Ensured to some extent

Purely ensured

Very low

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

process of wrapping variables and methods in a single unit is

abstraction

Polymorphism

Encapsulation

Overriding

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these access specifier must be used for class so that it can be inherited by another subclass?

public

private

protected

none of the mentioned

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The private member of a class can be accessible

Within the class in which it is declared

Within all the sub-classes of its class in any package where this class is visible

Within all the classes in the package containing its class

None of the above

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The protected member of a class can be accessible

Within the class in which it is declared

Within all the sub-classes of its class in any package where this class is visible

Within all the classes in the package containing its class

A and B

A, B, and C

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Non-subclasses in other packages cannot access protected members from other packages

True

False