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
Anna007 [38]
3 years ago
6

Determine the best access modifier for each of the following situations: a. A class Employee records the name, address, salary,

and phone number. b. An adding method inside of a class BasicMath.
Computers and Technology
1 answer:
Lorico [155]3 years ago
4 0

Answer:

a. Protected

b. Public

Explanation:

There are four acess modifier in Java.

Default: Acessible only within the same package.

Public: Can be acessed by any class.

Private: Acessible only within the class.

For example, you have a class employee and a private method. This method can only be accessed by an object that is an instance of an employee.

Protected: Used in classes that extend each other. For example, a class of employees would extend employee.

So:

a. A class Employee records the name, address, salary, and phone number.

The best acesses modifier is protected. A class may extended employee but have the same arguments(name, adress, salary, phone number), so it should also have acess to the method.

b. An adding method inside of a class BasicMath.

This method can be used in a variety of packages and projects and classes... and there is no important information regarding security. So the best method is public.

You might be interested in
Where can page numbers appear? Check all that apply.
umka2103 [35]

Answer:

in the header in the footer

Hope it helps!!!

Explanation:

4 0
3 years ago
Organ transplants are rarely successful.
Maurinko [17]

False......................

6 0
3 years ago
how can a user open a blank presentation? 1.on the file menu, click new, and then click recent templates 2.on the file menu, cli
4vir4ik [10]

2.  on the file menu, click new, and then click blank presentation.

5 0
3 years ago
The home keys on the numeric keypad are?
Eva8 [605]
4, 5 , 6 , and plus key
456+
5 0
3 years ago
Read 2 more answers
Describe a game that you have played (video game or other type of game) that had a good balance between being easy to learn the
Dmitry_Shevchenko [17]

Answer: Well my sister has a Super Mario Odyssey game for Nintend. The controls are easy to learn but the game is quite difficult. The goal is to find moons to catch up to Browser, who has stolen Mario’s friend, Peach. On the way you run into to challenges that are hard and easy. Overall the game is ballenced well. With amazing details and graphics.

Explanation:

4 0
3 years ago
Other questions:
  • IblMessage.txt=welcome to fiji.what is the error in the coding and what type of error is it?(explain)​
    5·1 answer
  • What is Microsoft first product
    6·2 answers
  • The ________ is responsible for the Internet's domain name system and the allocation of IP addresses. ICANN W3C ISOC IAB
    8·1 answer
  • A(n) _____ is a telephone facility that manages incoming calls, handling them based on the number called and an associated datab
    5·1 answer
  • Three common risk factors for young drivers and how you plan to minimize these factors.
    13·1 answer
  • Nhiệt độ chiết rót của máy chiết rót có van trượt là bao nhiêu
    6·1 answer
  • Which of the displays could be represented by a single bit?
    12·2 answers
  • Anyone know how to fix black screen of death on computer​
    6·1 answer
  • What is the appropriate source to find information about an organization?
    12·1 answer
  • Question 8 of 25
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!