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]
2 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]2 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
In which case will the linear search return the lowest value faster than the<br> binary search?
Sveta_85 [38]

Answer:

A linear search is one that scans every record/file until it discovers the value being searched for.

Binary search, on the other hand, is also known as <em>Logarithmic search</em>. It is used to locate the position of a value inside an array that has already been sorted.  

The linear search will return the lowest value faster than the binary search when small arrays are involved.

This will only be feasible when the array is sorted prior.

Cheers!

5 0
3 years ago
HELP ASAP PLZZZZZ
musickatia [10]

Answer:

third one

Explanation:

3 0
2 years ago
A _____ is a control that tells the computer what task to perform.
sammy [17]
I'm pretty sure the answer is code
7 0
3 years ago
Write a "for loop" that displays a string in the reverse order (DO NOT use the reverse method) 3.
elena55 [62]

Following are the code in java to reverse any string without using reverse function.

import java.util.*; // import package

class Main // class

{

public static void main(String args[])  // main class in java

{

String s, r = "";  // string variable

Scanner out = new Scanner(System.in);  // scanner classes to take input

System.out.println("Enter a string to reverse");

s = out.nextLine();  // input string

int l1 = s.length();  // finding length of string

l1=l1-1;

for ( int i = l1 ; i >= 0 ; i-- )  // for loop to reverse any string

{

r = r + s.charAt(i);

}

System.out.println(" The Reverse String is: "+r);  // print reverse string

  }

}

Explanation:

firstly we input any string ,finding the length of that string then after that iterating over the loop by using for loop and last display that reverse string

output

Enter a string to reverse

san ran

The Reverse String is: nar nas

5 0
3 years ago
A. =A1&lt;= A14<br> B. Income – Expenses<br> C. SUM(A1:A14)<br> D. =150*.05
Tpy6a [65]
B that the anser yep i whent and reserch the the anser so itsb
8 0
3 years ago
Other questions:
  • Select three examples of cryptographs. Security tokens Shared-key Malware Firewalls Message authentication code Public-key
    7·2 answers
  • What does the "configure dhcp options for proxy dhcp" option do?
    13·1 answer
  • Jeffrey works with a huge database of spreadsheet records each day. To organize and identify these spreadsheets, he wants to ass
    8·1 answer
  • A windows host sends a tcp segment with source port number 1200 and destination port number 25. the sending host is a(n) _______
    10·1 answer
  • 1. You have recently been hired by a leading firm, which provides information management solutions to large corporations. As a n
    12·2 answers
  • Find the range of the function for the domain<br>(-4,-2,0, 1.5,4).<br>f(x) = 5x²+ 4<br>​
    13·1 answer
  • We begin with a computer implemented in a single-cycle implementation. When the stages are split by functionality, the stages do
    13·1 answer
  • Example of Bandwidth Analogies: using Pipe
    11·2 answers
  • Is permanent software programmed into read-only memory.<br> Firmware<br> JavaScript<br> PHP<br> o
    7·1 answer
  • Gaining information by tricking an individual into releasing information is often referred to as.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!