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
Please help. will give u brainliest!! khan academy computers and the internet!!
Oxana [17]

Answer:

a or c

Explanation:

think of which answer seems illogical.

5 0
3 years ago
Jennifer stays fit by playing games that track the movement of her body. Which platform features such a physical interface featu
Usimov [2.4K]

Answer:

kinect xbox 360.

Explanation:

for example- just dance

7 0
3 years ago
Write a program to find the product of 3 numbers
ziro4ka [17]

Answer:

#include<iostream>

using namespace std;

int main()

{

   int a,b,c;

   cout<<"enter the value of a:";

   cin>>a;

   cout<<"enter the value of b:";

   cin>>b;

   cout<<"enter the value of c:";

   cin>>c;

   cout<<"product is:"<<(a*b*c);

   return 0;

}

Explanation:

6 0
3 years ago
Read 2 more answers
What two devices in a computer should be considered "black boxes," and should never be opened due to risks involving charged cap
NNADVOKAT [17]

The two devices in a computer that should be considered "black boxes," and should never be opened due to risks involving charged capacitors are MONITOR and POWER SUPPLY.

Explanation:

  • Physical contact or close proximity to the open power supply caused a discharge from the capacitor that resulted in an electric shock. Capacitors can discharge current even when not energized because they hold a charge for some time after the power is turned off.
  • To do harm to your body, the voltage across the capacitor's terminals must be high enough to cause a harmful effect on you. There are no hard rules for at what voltage things become harmful, but a common 'rule of thumb' is that DC up to 48 Volt is considered low voltage. So a capacitor charged to a voltage below 48 V is fairly safe.
  • A charged capacitor can be very dangerous, so it's important that you avoid coming into contact with the terminals at all times.
3 0
3 years ago
Your boss calls you from his home to use the VPN connection you configured for him
prisoha [69]

Its not c or b. I think it's a. Im not sure tho..

7 0
3 years ago
Other questions:
  • A ____________ variable is available throughout a program.
    7·1 answer
  • A client accessing a network share folder has authenticated into the system and has full access rights to a folder share. But af
    11·1 answer
  • Add is a function that accepts two int parameters and returns their sum.
    8·1 answer
  • What will happen if Sam goes to the View menu, clicks Toolbars, and then clicks Picture?
    12·2 answers
  • What will be the value of ans after the following code has been executed?
    10·2 answers
  • The shell of a document that may be used over and over in desktop publishing is called a
    9·1 answer
  • Write the code to replace only the first two occurrences of the word second by a new word in a sentence. Your code should not ex
    15·1 answer
  • What is this....... Iam booking train to patna. ​
    13·2 answers
  • Python program oranges and apples 3.4.6 copy and paste would be nice
    7·1 answer
  • What was the first computer
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!