1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lena [83]
3 years ago
9

Data hiding, which means that critical data stored inside the object is protected from code outside the object, is accomplished

in Java by: A. using the public access specifier on the class methods B. using the private access specifier on the class methods C. using the private access specifier on the class definition D. using the private access specifier on the class fields
Computers and Technology
1 answer:
algol [13]3 years ago
7 0

Answer:

Option (D) using the private access specifier on the class fields

Explanation:

  • The private access modifier can be used to hide the data.
  • Methods and data variables ( fields ) can be declared with the private access modifier.
  • Data hiding is a OOPS Concept which can be achieved with the private keyword (private access modifier).
  • The access modifiers are of types Public, Private, Protected and Default ( no access modifier - no need to explicitly specify the default keyword).
  • Data hiding means to hide the data, the data is contained in the class variables.So, option (d) using private access modifier on the class fields is correct option.
  • Option (A) is wrong as the using the public access modifier doesn't hide anything. It is public and is visible to the public.
  • Option (B) is wrong as using the private access modifier on the methods means it is hiding the implementation of the methods not the data.
  • Option (C) is wrong as using private access modifiers on class definition means making the classes not visible to other classes it doesn't mean data hiding as the data is contained in the class variables.
You might be interested in
We can improve our knowledge and skills on animals and fish raising with the use of internet​
bagirrra123 [75]

Answer:

yeah that would be great

5 0
3 years ago
The binary number represented by the voltage graph below is
Delicious77 [7]

Answer:

4

Explanation:

5 0
2 years ago
In this image, which feature did we most likely use to quickly change the background, fonts, and layout?
MAVERICK [17]

Answer: themes

Explanation:

Took the test

3 0
3 years ago
Help me please, I'm attempting a test<br>​
dusya [7]
It’s A it’s a keyboard
8 0
3 years ago
Read 2 more answers
Im timed!!!!!!!!!!!!!!!!!!<br><br> I NEED HELP ASAP<br> THANK YOU SO MUCH
Troyanec [42]

Answer:

card sorting

Explanation:

tell me if im wrong...

6 0
3 years ago
Read 2 more answers
Other questions:
  • The collodion process was significantly more expensive than the cost of a daguerreotype
    10·1 answer
  • Create a simple main() that solves the subset sum problem for any vector of ints. Here is an example of the set-up and output. Y
    12·1 answer
  • What important information is needed if you are installing an oem version of windows 7?
    6·1 answer
  • Using the ____ browsing mode offered by some browsers can prevent personal information from being left on a public computer.
    9·1 answer
  • Which of the following STEM discoverers developed a new type of computer hardware?
    11·1 answer
  • What do these terms have in common? google, yahoo!, bing they are important books. they are internet search engines. they are wo
    10·1 answer
  • Add a new row to a table by clicking in the
    10·1 answer
  • cpp g Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print fo
    15·1 answer
  • _________ can be used to provide access control, confidentiality, data origin authentication, connectionless integrity, rejectio
    12·1 answer
  • , how do you make this user <br> XtraCrispyIzzy<br> 12 characters or less for microsoft?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!