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
What project started the development of inter-network connections using tcp/ip that has evolved into the internet today.?
rosijanka [135]
Dial Up, help start it
3 0
3 years ago
Define the Artist class with a constructor to initialize an artist's information and a print_info() method. The constructor shou
nika2105 [10]

Answer:

class Artist():

   def __init__(self, artist_name=None, artist_birth_year=0, artist_death_year=0):

       self.artist_name = artist_name

       self.artist_birth_year = artist_birth_year

       self.artist_death_year = artist_death_year

   def display_artist(self):

       if self.artist_death_year == -1:

           print('{}, born {}'.format(self.artist_name, self.artist_birth_year))

       else:

           print('{} ({}-{})'.format(self.artist_name, self.artist_birth_year, self.artist_death_year))

class Artwork():

   def __init__(self, artwork_title=None, artwork_year_created=0, artist=Artist()):

       self.artwork_title = artwork_title

       self.artwork_year_created = artwork_year_created

       self.artist = artist

   def display_artist(self):

       print('artwork_title: {}'.format(self.artwork_title))

       print('Artist: ', end='')

       self.artist.display_artist()

def main():

   user_artist_name = input('Enter the name of artist: ')

   user_birth_year = int(input('Enter birth year: '))

   user_death_year = int(input('Enter death year: '))

   user_title = input('Enter master piece title: ')

   user_year_created = int(input('Enter year created: '))

   user_artist = Artist(user_artist_name, user_birth_year, user_death_year)

   new_artwork = Artwork(user_title, user_year_created, user_artist)

   new_artwork.display_artist()

if __name__ == "__main__":

   main()

Explanation:  

  • Inside the constructor of Artist class, initialize the essential properties.
  • Create the display_artist function that checks whether artist_death_year is equal to -1 and then displays an appropriate message according to the condition.
  • Apply the similar steps as above for the Artwork class.
  • Inside the main method, get the information from user and finally call the display_artist function to print the results on screen.
8 0
3 years ago
Which type of storage disk and disk drive can you use in the given situation?
Margarita [4]

Answer:

The answer to this question is DVD and DVD-RW

Explanation:

6 0
3 years ago
What is a license that is paid for by number of machines or number of people using the software?.
Kamila [148]

A license that is paid for based on the number of machines or number of people using the software application (program) is called: purchased license.

<h3>What is a software license?</h3>

A software license can be defined as a formal agreement between an end user (customer) and the owner of a software program or software developer, that allows him or her to perform certain tasks with the software application (program).

<h3>The types of software.</h3>

In Computer technology, there are three (3) main types of software programs based on usage rights and these include the following:

  • Shareware
  • Freeware
  • Purchased license

In conclusion, a purchased license is a type of license that is typically being paid for based on the number of machines or number of people that are using the software application (program).

Read more on software here: brainly.com/question/25703767

5 0
2 years ago
The area or the window that shows the current folder location​
Alex Ar [27]

Answer:

The focused window

Explanation:

However, please provide some more details about this because the question itself is very vague.

8 0
4 years ago
Other questions:
  • _____ is the widely used transport layer protocol that most Internet applications use with Internet Protocol (IP).
    9·1 answer
  • Hey I don’t have a question I’m just testing something on this app
    6·2 answers
  • The director of HR realizes that the KSAs currently used for hiring entry-level engineers are outdated. In order to establish wh
    5·1 answer
  • Which of the following technologies is the best choice to convey urgent and highly sensitive information? telephone fax letter e
    14·1 answer
  • Good business ethics is a good marketing strategy. Discuss
    13·1 answer
  • Nikki sent flyers in the mail to all houses within the city limits promoting her computer repair service what type of promotion
    10·2 answers
  • use the internet to research the SYSTEM account. Why is it nessesary to include this account with full control on a directory
    13·1 answer
  • Use ordinary pipes to implement an inter-process communication scheme for message passing between processes. Assume that there a
    12·1 answer
  • QueSUUN TU
    15·1 answer
  • What is the advantage of learning through story compared to learning through personal experience?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!