subject

Consider the definition of the Person class below. The class uses the instance variable adult to indicate whether a person is an adult or not. public class Person
{
private String name;
private int age;
private boolean adult;
public Person (String n, int a)
{

name = n;
age = a;
if (age >= 18)
{
adult = true;
}
else
{
adult = false;
}
}
}

Which of the following statements will create a Person object that represents an adult person?

a. Person p = new Person ("Homer", "adult");
b. Person p = new Person ("Homer", 23);
c. Person p = new Person ("Homer", "23");
d. Person p = new Person ("Homer", true);
e. Person p = new Person ("Homer", 17);

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 12:10
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
question
Computers and Technology, 24.06.2019 08:10
Where are american poets found in the dewey decimal system
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
1. which of these is not true about torsion bars? a. they can be used to adjust ride height b. they can be adjusted anytime since they don't affect alignment angles c. they attach between the frame and the lower control arm d. they twist to produce a spring effect
Answers: 1
You know the right answer?
Consider the definition of the Person class below. The class uses the instance variable adult to ind...
Questions
question
Mathematics, 05.02.2021 20:00
question
Mathematics, 05.02.2021 20:00
question
Mathematics, 05.02.2021 20:00
question
Mathematics, 05.02.2021 20:00
question
Mathematics, 05.02.2021 20:00
question
Mathematics, 05.02.2021 20:00
question
Mathematics, 05.02.2021 20:00
Questions on the website: 13722362