Solution to implement category in Java
<blockquote>
You want to create a program for the management of a telephone book.
For each person are provided for the following personal information:

<pre>
Surname
Name
Title
E-mail address (can not contain spaces and must contain the @ symbol)
Company
Position
</pre>

For every person you can store the following telephone numbers (one for each category)
<pre>
Home
Office
Mobile Phone.
</pre>

You can also store a list of other phone numbers. For each of the other numbers, you must store over to the phone number
a description of the number.

</blockquote>

<p>Here it is a homework I have to make for this evening in Java.
My issue is how I can implement the various category: Home,Office,ecc...Which is the best solution to implement those category? maybe an enum?</p>

<p>Here it is my implementation:</p>

<pre><code>import java.util.*;

public class Persona {

private String Name;
private String surname;
private String title;
private String mail_addr;
private String company
private String position;
private Phone homePhone;
private Phone officePhone;
private Phone mobilePhone;
private Collection&lt;Phone&gt; otherphonesList

public Persona(String n,String s,String t,String m,String c,String p,Phone hp,Phone of,Phone mp,Collection&lt;Phone&gt; otherphones)
{
    name=n;
    surname=s;
    title=t;
    mail_addr=m;
    company=c;
    position=p;
    homePhone=hp;
    officePhone=of;
    mobilePhone=mp;
    otherphonesList=new ArrayList&lt;Phone&gt;(otherphones);
}

public String getName()
{
    return name;
}

public String getSurname()
{
    return surname;
}

public String getTitle()
{
    return title;
}

public String getMail()
{
    return mail_addr;
}

public String getCompany()
{
    return company;
}

public String getPosition()
{
    return position;
}
}


public class Phone {

private String  phone;
private String description;

public Phone(String phone,String description)
{
    this.phone=phone;
    this.description=description;
}

public String getPhone()
{
    return phone;
}

public String getDescription()
{
    return description;
}


}
</code></pre>
