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
The primary stream fed by tributaries within a dendritic drainage network is termed a ________ stream
a_sh-v [17]
<span>TRUNK. In a dendritic system, there are many smaller rivers or streams (the "twigs" of the tree), which are then merged into the tributaries of the main river (the branches and the trunk of the tree, respectively). They tend to develop in V-shaped valleys</span>
6 0
3 years ago
Silvia fue a una revisión odontológica porque tiene problemas de salud en la dentadura y sus cepillos sólo duran dos semanas. Ah
Neko [114]

Answer: ella puede usar un cepillo de dientes eléctrico

8 0
2 years ago
Insufficient vacuum will require the driver to _______________ to adequately activate the brakes?
sp2606 [1]
A i think idk im trying to earn points
8 0
3 years ago
State three reasons why users attach speakers to their computer​
____ [38]

Answer:

For listening sake

To listen to information from the computer

They receive audio input from the computer's sound card and produce audio output in the form of sound waves.

8 0
2 years ago
Traditionally, remote administrative access on routers was configured using Telnet on TCP port 23. However, Telnet was developed
FinnZ [79.3K]

<u>Explanation</u>:

It is an all-too-often used technology today in connecting several computers together via a network.

Routing simple terms means the action of selecting the path taken by the traffic of data in a network of computers. The routing systems involve the use of both wireless and cable based architectures. Some common example of routing systems includes:

  1. Dynamic Routing
  2. Static routing
  3. Default Routing
5 0
3 years ago
Other questions:
  • You are training to complete in a local 5K run. You record your time scores in minutes after completing seven practice runs. Wri
    5·1 answer
  • If you turn on the Lock alpha button , what happens
    5·2 answers
  • A byte contains how many bits? Question 3 options:
    13·2 answers
  • You are in the middle of a big project at work. all of your work files are on a server at the office. you want to be able to acc
    14·1 answer
  • Having data in a column formatted differently based on value is known as
    7·1 answer
  • Buying the newest phone as soon as it is released when your current phone works perfectly is not a good idea for all but which o
    10·2 answers
  • In a word-processing program, what are the easily accessible icons that allow you to print, save and change fonts with a click o
    8·1 answer
  • Help a brotha out..................
    10·1 answer
  • Where else can the computer send the results of processing other than to output​
    13·1 answer
  • Which workbook view is used most often in Excel?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!