Request with an input for a initialized Object
<p>I want to call an Object with a specific name which i type into the console.
I know a way would be with a switch statement but it should work also with new initialized Objects.</p>

<p>here is an example of code.</p>

<pre><code>BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    String nameObject=null;
    // Create a new Object with a specific name
    System.out.println("Type in the name of the Object");
    try {
        nameObject = reader.readLine();
    } catch (IOException e) {

    }
    Person NewPerson = new Person(nameObject);


    System.out.println("Which Person do you want to have?");
 String requestName = reader.readLine();
//search for the object which has the name requestName
// after this i want find the right person with an reader.??
</code></pre>