subject

Consider the following class definition.

public class Person {
private String name; /* missing constructor */
}
The statement below, which is located in a method in a different class, creates a new Person object with its attribute name initialized to "Washington". Person p = new Person("Washington");

Which of the following can be used to replace /* missing constructor */ so that the object p is correctly created?

A)
private Person()
{
name = n;
}
B)
private Person(String n)
{
name = n;
}
C)
public Person()
{
name = n;
}
D)
public Person(String n)
{
name = n;
}
E)
public Person(String name)
{
String n = name;
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Communication is the exchange of information. true false
Answers: 2
question
Computers and Technology, 23.06.2019 07:00
1. you have a small business that is divided into 3 departments: accounting, sales, and administration. these departments have the following number of devices (computers, printers, etc.): accounting-31, sales-28, and administration-13. using a class c private network, subnet the network so that each department will have their own subnet. you must show/explain how you arrived at your conclusion and also show the following: all available device addresses for each department, the broadcast address for each department, and the network address for each department. also, determine how many "wasted" (not usable) addresses resulted from your subnetting (enumerate them).
Answers: 3
question
Computers and Technology, 23.06.2019 07:00
What are three software programs for mobile computing?
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
You know the right answer?
Consider the following class definition.

public class Person {
private String na...
Questions
question
Mathematics, 13.01.2021 01:40
question
Geography, 13.01.2021 01:40
question
Spanish, 13.01.2021 01:40
question
Arts, 13.01.2021 01:40
question
Mathematics, 13.01.2021 01:40
question
Mathematics, 13.01.2021 01:40
question
Computers and Technology, 13.01.2021 01:40
question
Mathematics, 13.01.2021 01:40
question
Computers and Technology, 13.01.2021 01:40
question
Mathematics, 13.01.2021 01:40
Questions on the website: 13722363