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
"Bullet Lists" can be which of the following?
MariettaO [177]

Answer:

letters and numbered

Explanation:

7 0
3 years ago
Read 2 more answers
Which of the following is true about strings?
pickupchik [31]

Answer:

Your answer is option C, or the third option.

They do not let the user type in letters, numbers, and words.

Explanation:

Strings are defined as a sequence of characters literal, constant, or variable. These sequences are like an array of data or list of code that represents a structure. Formally in a language, this includes a finite(limited) set of symbols derived from an alphabet. These characters are generallu given a maximum of one byte of data each character. In longer languages like japanese, chinese, or korean, they exceed the 256 character limit of an 8 bit byte per character encoding because of the complexity of the logogram(character representing a morpheme((which is the simpliest morphological(form or structure) unit of language with meaning)) character with 8 bit (1 byte, these are units of data) refers to cpu(central processing unit) which is the main part of a computer that processes instructions, and sends signals.

5 0
3 years ago
What is a router?
DIA [1.3K]

Answer:

A) a device that sends data to the receiving device

Explanation:

3 0
3 years ago
Write a single statement that will print the message "first is " followed by the value of first, and then a space, followed by "
Hatshy [7]

Answer:

Statement:

print("first is "+str(first)+"  second = "+str(second)) # It is a python statement where first and second are variable of any type.

Explanation:

  • The above statement is the print statement that prints the value of first and second variables like in the form of "first is" value of the first variable, then space, then "second = b" and then the value of the second variable.
  • The value for the first and the second variable of any type but it convert it into string form with the help of str() function in the print statement.
  • The string of the print statement can be formed by the help '+' operator which adds the string with the value and the other string in print statement in java and python language.
4 0
3 years ago
What is your favorite coler and what do you like to do and
KIM [24]

Answer:

Orange

Explanation:

I like orange because its vibrant.

7 0
3 years ago
Other questions:
  • The likelihood of the occurrence of a vulnerability multiplied by the value of the information asset - the percentage of risk mi
    12·1 answer
  • John works for Internal Computer Specialists, which focuses on helping small business owners resolve MIS infrastructure issues.
    12·1 answer
  • What is is the privacy risks with health care robots?
    8·1 answer
  • What languages other than English are spoken in the United States?
    14·1 answer
  • How do you measure objects and re-size them in tinkercad? I need it in steps.
    7·1 answer
  • The shortest compressed format of the ipv6 address 2001:0db8:0000:1470:0000:0000:0000:0200 is
    6·1 answer
  • Technician A says that automotive engine blocks are usually classified by the number of cylinders the block. Technician B says t
    9·1 answer
  • Define a function below called average_strings. The function takes one argument: a list of strings. Complete the function so tha
    11·1 answer
  • A(n) ____ string contacts the data source and establishes a connection with the database using the Data Source Configuration Wiz
    5·1 answer
  • HELP! WILL GIVE BRAINLIEST
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!