this is what i have so far.
public class PersonalInformation{
/* ===================================================
===== Challenge 6.1 - Personal Information Class =====
======================================================
Design a class that holds the following personal data: name, age, and phone number.
Write appropriate accessor and mutator methods. Demonstrate the class by writing a
program that creates three instances of it. One instance should hold your information,
and the other two should hold your friends' or family member's information.
*/
public static void main(String[] args) {
// Create the objects.
// Set my info.
PersonalInformation myInfo = new PersonalInformation();
name startName = new name("Joe Mahoney");
startAddress.setAddress("724 22nd Street");
startAge.setAge("27");
startPhoneNumber.setPhoneNumber("(555)555-1234");
// Set friend #1's info.
PersonalInformation myFriend1 = new PersonalInformation();
name startName = new name("Geri Rose");
startAddress.setAddress("149 East Bay Street");
startAge.setAge("24");
startPhoneNumber.setPhoneNumber("(555)555-5678");
// Set friend #2's info.
PersonalInformation myFriend2 = new PersonalInformation();
name startName = new name("John Carbonni");
startAddress.setAddress("22 King Street");
startAge.setAge("28");
startPhoneNumber.setPhoneNumber("(555)555-0123");
// Display my info.
// Display friend #1's info.
// Display friend #2's info.
}
}
public class PersonBuilder
{
private String name; // A person's name
private String address; // A person's address
private int age; // A person's age
private int phoneNumber; // A person's phone number
PersonalInformation(String startName, String startAddress, int startAge, int startPhoneNumber) {
name = startName;
address = startAddress;
age = startAge;
phoneNumber = startPhoneNumber;
}
/**
The setName method sets the person's name.
@param n The person's name.
*/
/**
The setAge method sets the person's age.
@param a The person's age.
*/
/**
The setAddress method sets the person's address.
@param a The person's address.
*/
/**
The setPhone method sets the person's phone number.
@param p The person's phone number.
*/
/**
The getName method returns the person's name.
@return The person's name.
*/
public String getName(String Name){
return name;
}
/**
The getAge method returns the person's age.
@return The person's age.
*/
public String getAge(String Name){
return age;
}
/**
The getAdress method returns the person's address.
@return The person's address.
*/
public String getAddress(){
return address;
}
/**
The getPhone method returns the person's phone number.
@return The person's phone number.
*/
public int getPhoneNumber(){
return phoneNumber;
}
}