Creating objects from data entered by user
<p>I'm working on a homework project that requires me to create an object from data entered by a user. I have a class called Person which takes the basic information, a class called Customer which extends the Person class and includes a customer number and a class called Employee which extends the Person class and returns a social security number.</p>

<p>I have pasted the code from my main program below. I'm a little confused on a couple of things. First when I'm collecting the information (first name, last name etc) amd I supposed to be accessing my Person class in there somehow?</p>

<p>Second I guess more plainly, how do I create the object? so far in all of the examples I have read online I find they seem to enter the information already like if I were to have it say</p>

<pre><code>    Person firstName = new Person(Jack);
</code></pre>

<p>Although I am collecting the information from the user so I don't see how to tell it like</p>

<pre><code>    Person firstName = new Person (enter info from user here);
</code></pre>

<p>Finally and again this is a really dumb question but I have to create a static method that accepts a Person object. 
To create the static method I'm assuming it is </p>

<pre><code>    Public Static print()
</code></pre>

<p>but how do I tell it to print something from the person class? how does it know?</p>

<p>Most of my examples in the book include a class that contains all of the information instead of making the user enter it which is confusing because now I'm being told the user has the freedom to type what they want and I need to collect that information.</p>

<pre><code>    import java.util.Scanner;
    public class PersonApp 
    {


public static void main(String[] args) 
{
    //welcome user to person tester
    System.out.println("Welcome to the Person Tester Application");
    System.out.println();

    Scanner in = new Scanner(System.in);


    //set choice to y
    String choice = "y";
    while (choice.equalsIgnoreCase("y"))
    {

        //prompt user to enter customer or employee
        System.out.println("Create customer or employee (c/e): ");
        String input = in.nextLine();

        if (input.equalsIgnoreCase("c"))
        {
            String firstName = Validator.getString(in, "Enter first name: ");
            String lastName = Validator.getString(in, "Enter last name: ");
            String email = Validator.getEmail(in, "Enter email address: ");
            String custNumber = Validator.getString(in, "Customer number: ");
        }

        else if(input.equalsIgnoreCase("e"))
        {
            String firstName = Validator.getString(in, "Enter first name: ");
            String lastName = Validator.getString(in, "Enter last name: ");
            String email = Validator.getEmail(in, "Enter email address: ");
            int empSoc = Validator.getInt(in, "Social security number: ");
        }


    }




    System.out.println("Continue? y/n: ");
    choice = in.next();


}
</code></pre>

<p>}</p>
