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
Analyze the following code. Is count < 100 always true, always false, or sometimes true or sometimes false at Point A, Point
GaryK [48]

Answer:

Point A: Always True

Point B: Sometimes false

Point C: Always False

Explanation:

In the given code snippet. Point A is the first statement within the While loop the statement System.out.println("Welcome to Java!"); will only be executed if the while condition evaluates to true.

At Point B, The statement count++ increases the value of the counter at every iteration, while it will be true for most occasions, at the last increament, this statement will be false that is at count=100, The condition will be false at this point just before program execution breaks out of the loop

Point C is outside of the loop, this happens when the given condition is no longer true.

8 0
3 years ago
What environmental hazards exist because of man’s desire for profit?
Anastasy [175]
Cutting down trees for paper
5 0
3 years ago
Read 2 more answers
Which sentence describes a task on which a genetic engineer is most likely to work?
galina1969 [7]

Answer:

C

Explanation:

If you look at the picture, you will see why it is C. It says D, but the multiple choices are differently ordered and it is kind of differently worded.

But in conclusion, the answer is C.

5 0
3 years ago
Read 2 more answers
Mi laptop dice the computer restarted unexpectedly or encountered an unexpected error.Windows installation cannot procced.To ins
borishaifa [10]

Answer:

Explanation:

There are two reasons as to what could have happened with your laptop. The first one is that your laptop was installing a critical windows update which got corrupted when the laptop's battery died causing windows itself to become corrupted. In this case, you would need to format the hard drive and reinstall windows. The second reason could be that your hard drive is failing and not allowing Windows to load or properly be installed on it. In this second scenario you would need to buy and replace the hard drive.

4 0
3 years ago
Determine whether the compound condition is True or False.
Viktor [21]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The given compound statement are:

4 < 3 and 5 < 10

4 <3 or 5 < 10

not (5 > 13)

4 < 3 and 5 < 10  this statement is false because "and" logical operator required that both operand (4<3) and (5<10) are true. Statement (4<3) is a false statement so this statement is false. "and" operator becomes true when all its inputs are true otherwise it becomes false.

4 < 3 or 5 < 10  this statement is true because "or" logical operator to be true if one of its input is true and false when all inputs are false. so in this compound statement, the first statement is false and the second statement is true. so this compound statement is true.

not(5>13) this compound statement is true because it has "not" operator and "not" operator makes a false statement to true and vice versa. so (5>13) is a false statement, and when you append "not" operator before it, then this compound statement will become true statement, so this is a true statement.

7 0
3 years ago
Other questions:
  • What is the slide sorter view used for?
    11·1 answer
  • A(n) ______ is a type of collaborative website that allows users to create, add, modify, or delete website content.
    12·1 answer
  • 3. What term refers to the physical locations of elements in relation to each other?
    10·2 answers
  • If a speed mismatch was configured between two Cisco routers' Ethernet interfaces, what would the status of this interface be?
    12·1 answer
  • Which of the following is another term for a subfolder?
    9·1 answer
  • Which of the following is the result of a query?
    9·1 answer
  • (15) What is the best definition of a contextual tab?
    8·1 answer
  • Which line of code will only allow a symbol to be stored in a variable?
    11·2 answers
  • How many cubic millimeters are present in 0.0923 m3?​
    14·1 answer
  • What is the importance of knowing the concept of programming?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!