title: How to use String name with other way
body: <p>I want with simple way to use a name (String) with not using this code <code>useUserInput.getString()).equalsIgnoreCase("name"))</code>.What I mean is, this exercise for example says if it is Stereo-if it is Aerio, etc. I don't want for each one to make user write it. I want to do something to do not to write. With other words it is difficult to understand me maybe, the dog, the cat, the monkey I want to refer to a class like the dog the cat the monkey with not using the expression up. How would you write the down code, differently?</p>
  
  <pre><code>static int N; //from keyboard
   static String Typos; // i use userinput string
      public static void main(String[] args) {
     //abstract class Metafores subclasses Stereo-Ygro-Aerio-Meikto
     Metafores[] pin = new Metafores[N];
      for (int i = 0; i &lt; 10; i++) {
          pin[i] = new Stereo();
          pin[i+10] = new Ygro();
          pin[i+20] = new Aerio();
          pin[i+30]=new Meikto();
      }
  
  
      // exceptions
      System.out.println("An einai Ygro,aeria,meiktou barous tha exoume eksairesh-grapste analoga"); // it is just a message 
                if ((Typos = UserInput.getString()).equalsIgnoreCase("Ygro"))  { // here there is the problem i dont want to make the user to write it
          throw new IllegalExceptionMetaforas("Ta ygra dn metaferontai me aeroplano "); // show the exception 
  
     }
  System.out.println("An einai aeria tha exoume eksairesh");
       if ((Typos = UserInput.getString()).equalsIgnoreCase("aeria"))  {
          throw new IllegalExceptionMetaforas("Ta aeria dn metaferontai me to aeroplano");
  
     }
       System.out.println("An einai meiktou barous");
       if ((Typos = UserInput.getString()).equalsIgnoreCase("meiktou barous"))  {
          throw new IllegalExceptionMetaforas("Meiktou barous dn metaferontai me to aeroplano");
  
     }
  }
      }
  </code></pre>