Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is about the accessibility of members with different access modifiers in Java. Select the two statements below that are correct. - Data hiding is

This is about the accessibility of members with different access modifiers in Java.

Select the two statements below that are correct.

- Data hiding is supported by declaring all instance variables and instance methods private.

- Generally you should declare instance variables as public and instance methods as private.

- Instance variables that are to be accessible via inheritance, only to the subclasses (in any package) of the defining class, should be declared as private.

- Instance variables that are to be accessible via inheritance, only to the subclasses (in the same package) of the defining class, should have no access modifier stated.

- There are exactly four levels of access in java.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

How do auditors assess the going concern assumption of a business?

Answered: 1 week ago