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
blondinia [14]
3 years ago
14

Define a class named person that contains two instance variables of type string that stores the first name and last name of a pe

rson and appropriate accessor and mutator methods. Also create a method named displayDetails that outputs the details of a person
Computers and Technology
1 answer:
Katarina [22]3 years ago
5 0

Answer:

Answered below

Explanation:

//Program is written using Java programming language.

Class Person {

private string firstName;

private string lastName;

void set firstName(string a){

firstName = a;

}

string getFirstName(){

return firstName;

}

void setLastname( string b){

lastName = b;

}

string getLastName( ){

return lastName;

}

void displayDetails( ) {

System.out.print(firstName);

System.out.print (lastName);

}

}

//Test program

Class Main{

public static void main(String args [] ){

Person person = new Person( )

person.setFirstName("Karen")

System.out.print(person.getFirstName)

person.displayDetails()

}

}

You might be interested in
Which of these purchases is most likely to be paid for with a credit card
Vesna [10]

Answer:

plane ticket?

Explanation:

7 0
3 years ago
What does a code of conduct include.
anygoal [31]
A code of conduct includes rules and responsibilities for the individual or party
8 0
3 years ago
Read 2 more answers
A personal computer can only have one operating system installed on it. true false
Pani-rosa [81]
It is true, because if you would try installing another OS after installing the first one, you would overwrite the OS which you installed before.
but in the second opinion an workstation is technically able to dual boot by installing differend operating systems on different drives. which approves that both answers can be right.
8 0
3 years ago
A listed electrical box for use in fire-resistive assemblies is being installed in a 2 hour rated wall. Assuming there are no ot
gtnhenbr [62]

Answer:

b. 1/8"

Explanation:

In This scenario this installation does not require any penetration protection as long as the space between the electrical box and the wall membrane does not exceed 1/8 of an inch. This is mainly a safety precaution to prevent accident's such as an electrical fire or electrocution as well as meeting the specs for the rest of the house to be built perfectly without modifications.

6 0
4 years ago
What was true of Northern cities?
lara [203]

Answer:

D. Segregation was practiced even where it was not the law.

Explanation:

7 0
3 years ago
Other questions:
  • When you enable user access control (uac)
    11·1 answer
  • Dr. Laos gets a referral for a 6 month old who has become listless and stopped eating lately. Her pediatrician wanted her to be
    15·1 answer
  • Which of these decisions would u most likely make on ur own
    8·2 answers
  • Siva added a Contact Form to her website. This is used for the collection to be included in
    5·1 answer
  • Research different ways that 3D printing is used in society. Tell us about the items that are 3D printed.
    8·2 answers
  • What binary number is the output of adding 1001011 and 100000?
    13·1 answer
  • The conversion of decimal 0.0625 into its binary equivalent. Explain.
    7·1 answer
  • How can users open a shared worksheet if they do not have Excel installed on a computer? visit Microsoft’s website use Office365
    6·1 answer
  • Before her shift as a cashier at the grocery store, Carla pulls her hair back into a ponytail and makes sure her fingernails are
    15·2 answers
  • Anyone on ps4 willing to trade me a fennec or McClaren on rocket league?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!