Thanks in advance
public class Contact
{
private String firstName;
private String surname;
private String address;
private String telNumber;
private String emailAdd;
public Contact(String firstName, String surname,
String address, String telNumber, String emailAdd)
{
this.firstName = firstName;
this.surname = surname;
this.address = address;
this.telNumber = telNumber;
this.emailAdd = emailAdd;
}
public String getFirstName()
{
return firstName;
}
public String getSurname()
{
return surname;
}
public String getAddress()
{
return address;
}
public String getTelNumber()
{
return telNumber;
}
public String getEmailAdd()
{
return emailAdd;
}
public String printDetails()
{
String s = new String("First Name: " + firstName + "\nSurname: " + surname +
"\nAddress: " + address + "\nTelephone Number: " + telNumber +
"\nEmail: " + emailAdd + "\n");
return s;
}
}
public class AddressBook
{
private Contact[] addBook;
private static int counter = 1;
private void AddressBook()
{
Contact[] addBook = new Contact[100];
counter = 1;
}
public void AddToAddBook(Contact name)
{
Contact theName = name;
addBook[counter] = theName;
counter++;
}
public Contact[] ShowAddBook()
{
return addBook;
}
}


Sign In
Create Account

Back to top









