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
We are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the path between source and destination
Daniel [21]

Answer:

Option  A is the correct answer.

Explanation:

8 0
3 years ago
ANSWER IN 5 MINUTES TO GET 50 POINTS!!!
Luba_88 [7]
The answer is d. Hope that helps.
7 0
3 years ago
What are potential problems with using nanorobots ?
mash [69]
It can penetrate the blood-brain barrier.
5 0
3 years ago
How has the shift to locally grown produce decreased greenhouse emissions?
Katen [24]

Answer:

How has the shift to locally grown produce decreased greenhouse emissions? 1 Large farms often create greenhouse emissions by poor farming practices. 2 Locally grown produce allows fewer dangerous toxins to seep into the soil and the atmosphere.

3 0
2 years ago
Find the double word-length 2's complement representation of each of the following decimal numbers:a. 3874
miss Akunina [59]

Answer:

-3874₁₀ = 1111 1111 1111 1111 1111 1111 1101 1110₂

Explanation:

2's complement is a way for us to represent negative numbers in binary.

To get 2's complement:

1. Invert all the bits

2. Add 1 to the inverted bits

Summary: 2's complement = -N = ~N + 1

1. Inverting the number

3874₁₀ = 1111 0010 0010₂

~3874₁₀ = 0000 1101 1101₂

2. Add 1 to your inverted bits

~3874₁₀ + 1 = 0000 1101 1101₂ + 1

= 0000 1101 1110₂

You can pad the most signigicant bits with 1's if you're planning on using more bits.

so,

12 bits                          16 bits

0000 1101 1110₂  = 1111 0000 1101 1110₂

They asked for double word-length (a fancy term for 32-bits), so pad the left-most side with 1s' until you get a total of 32 bits.

           32 bits

= 1111 1111 1111 1111 1111 1111 1101 1110

7 0
3 years ago
Other questions:
  • Your task in this assignment is to exploit the race condition vulnerability in the above set-uid program. more specifically, you
    14·1 answer
  • Fill in the blank
    11·1 answer
  • The expression 10,785(1.0275)x represents the amount of money in an investment account with interest that compounds annually for
    14·2 answers
  • Find the Nearest Repeated Entries in an Array People do not like reading text in which a word is used multiple times in a short
    15·1 answer
  • What is a Hard Drive
    13·1 answer
  • س2) اکتب خوارزميه لحل المعادلة الرياضيه الاتيه
    9·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    9·1 answer
  • What are some of the ways we can resolve IPv4 address shortages? Check all that apply.
    13·1 answer
  • What do you get with brainly points
    9·1 answer
  • QUICK HELP ME PLEASE
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!