title: How to create new object name by user input
body: <p>I want to create new object and to give it user input name.</p>
  
  <p>Example user input "robert" wil match to:</p>
  
  <pre><code> Action robert = new Action();
   robert.eat();
  </code></pre>
  
  <p>What do I need to change in the program so I can create a new object with a dynamic name?
  Many Thanks.
  I write the next code:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Human {
  
      /**
       * @param args
       */
      public static void main(String[] args) {
          // TODO Auto-generated method stub
          Scanner user_input = new Scanner( System.in );
  
          String first_name;
          System.out.print("Enter your first name: ");
          first_name = user_input.next( );//robert
  
          System.out.println("You are " + first_name);//robert
  
          Action first_name = new Action();
          Food orange = new Food();
          robert.eat(orange);
  
      }
  
  }
  </code></pre>