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
10. Which of these is not an HTTP verb? PUT AJAX GET DELETE
Korolek [52]

Answer:

Brainliest!

Explanation:

The primary or most-commonly-used HTTP verbs (or methods, as they are properly called) are POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations, respectively. There are a number of other verbs, too, but are utilized less frequently.

-

restapitutorial

.

com

3 0
3 years ago
4. In paragraph 7, what is the meaning of the phrase "not
galben [10]

Answer:

you need to give context of the situation

7 0
3 years ago
In addition to telling you which programs are currently running, what other information does the task bar display
faust18 [17]

I've got task manager open right now; it shows you

  • Applications
  • Processes
  • Services
  • Performance
  • Networking
  • Users

(In that order)

6 0
3 years ago
1. what is the purpose of giving an id to an html element when using javascript?
bazaltina [42]

Answer:

It is also used by JavaScript to access and manipulate the element with the specific id.

3 0
2 years ago
Na2CO3 → Na2O + what
Katarina [22]

Answer:

CO3

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • #TODO: Define a data structure to keep track of which links are part of / not part of the spanning tree.
    14·1 answer
  • Given a floating point variable fraction, write a statement that displays the value of fraction on the screen. Do not display an
    13·1 answer
  • Write the execution steps if the input is a lion.
    11·1 answer
  • When using query by example (qbe) in the data manipulation component of a database management system (dbms), the _____ is used w
    5·1 answer
  • Where (what memory location) is the data read from for the following code:
    12·1 answer
  • Dan works for an automobile company. He has designed a new model of a car based on an older version. Which technology can he use
    6·1 answer
  • Is this statement true or false?
    11·1 answer
  • Example of negative body language include all but
    8·1 answer
  • Most significant effect the rotary press had on printing
    9·1 answer
  • Goals of the project objectives
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!