Question: Please do not use this code or anything similar. Person.java: public class Person { private String firstName; private String lastName; private String hometown; private String

Please do not use this code or anything similar.

Person.java:

public class Person {

private String firstName;

private String lastName;

private String hometown;

private String state;

public Person(String firstName, String lastName, String hometown, String state) {

this.firstName = firstName;

this.lastName = lastName;

this.hometown = hometown;

this.state = state;

}

public String getFirstName() {

return firstName;

}

public String getLastName() {

return lastName;

}

public String getHometown() {

return hometown;

}

Please do not use this code or anything similar. Person.java: public class

In this lab you will create a Person class and 2 objects of this class. You will also display the data from each object. Deliverable A zipped NetBeans project with 2 classes App - Person Classes The Person Class The attributes - String firstName - String lastName - String hometown - String state The App class Create 2 Person objects called p1 and p2. - p1 data: firstName - Jillian lastName - Jennings hometown - Montclair state - NJ - p2 data: firstName - Keaton lastName - Ellis hometown - State College state - PA 1. display the the data for each object as specified below: - if the state attribute is "PA", display the object's attribute name plus the message "is from Pennsylvania" - if the state attribute is not "PA". display the object's attribute name plus the message "is from out-of-state" - make sure you display the data using the objects p1 and p2 - A statement using a fixed string is not a correct answer - System.out.println("Jillian is out-of-state"); is not the answer - looking at the data and having specific "system.out" is not the correct answer - You need to use if statements (or other kind of tests) to handle any variable/object

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!