Search Header Logo

Encapsulation & access Modifiers

Authored by Archana Pasalkar

Computers

University

Used 1+ times

Encapsulation & access Modifiers
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers