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
A 'array palindrome' is an array which, when its elements are reversed, remains the same (i.e., the elements of the array are sa
stiv31 [10]

Answer:

This code is written in MATLAB.

function [result] = isPalindrome(array,length)

if length == 0 || length == 1 %if the array is empty or contains only one element, the array is a palindrome

result = 1;

else

for i = 1:length/2 %check all the elements forward and backward until the middle is reached

if array(i) ~= array(end+1-i)

result = 0;

return

end

end

result = 1;

end

Explanation: Please read the comments in the code. In MATLAB, Boolean values are 1 or 0 instead of True or False.

6 0
3 years ago
Which two technologies support the building of single-page applications? and are two technologies helpful in building single pag
Sholpan [36]

Answer:

You can use JavaScript, HTML, PHP and so forth.

Explanation:

7 0
4 years ago
Create a variable ‘temp’ and assign the value in Celsius. Display the message ‘It’s extremely hot day today!’ if the temperature
Likurg_2 [28]

Answer:

This code is written using C++

Comments are used for explanatory purpose

Program starts here

#include<iostream>

using namespace std;

int main() {

int temp;

//Prompt user for input

cout<<"Enter temperature (in Celcius): ";

//Check if input is acceptable

while(!(cin>>temp)) {

cout << "That was invalid. Enter a valid digit: "<<endl;

cin.clear(); // reset the failed input

cin.ignore(123,'\n');//Discard previous input

}

//Check if temp is greater than 40

if(temp>40) {

cout<<"It's extremely hot day today!";

}

else{//If otherwise

cout<<"It's not too hot!";

}

return 0;

}

//End of Program

3 0
4 years ago
Five internal peripheral devices pls help​
LekaFEV [45]

Answer:

TV card, CD-R drive, Floppy Disk, Sound Card, and CD-ROM drive are examples of internal peripheral devices!(Basically hard drives and something like that)

Explanation:

7 0
3 years ago
Read 2 more answers
Which of the following is an advantage to using
stiks02 [169]

Answer:

There are 2 correct answers,

- It is easily read by most software and hardware because it requires little processing.

- It can be used by programmers for source code files.

7 0
3 years ago
Other questions:
  • Unlike a virtual image, a real image
    7·1 answer
  • What are the technique CSP does for the Cloud Storage Security?
    10·1 answer
  • data structureWe have two containers: one has a capacity of three gallons of water, the other five gallons. Both are initially e
    11·1 answer
  • Question 1 :The most common business firewall technique is to use a firewall server in conjunction with:This task contains the r
    11·1 answer
  • To deny a host from sending HTTP traffic destined to a specific server you will need to apply a __________ Access Control List.
    12·2 answers
  • What advantage does digital storytelling have over oral storytelling traditions?
    6·1 answer
  • You have a network of ten computers connected to a single switch that has 12 ports. You need to add six more computers to the ne
    12·1 answer
  • When workers use techology to work from home or an office center, they are
    7·2 answers
  • What are the buisness debts called?
    7·1 answer
  • program that initialises a vector with the following string values: “what” “book” “is” “that” “you” “are” “reading”.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!