title: How to print out only return value of a method?
body: <p>I've got a homework that I should write a couple of methods(e.g. a method that prompts customer for the car type and returns a valid car type) and then my program should display the car type, number of days car rented for,extras etc. This is first method that teacher wanted me to write ,</p>
  
  <pre><code>public static String promptForCarType(){
          Scanner input = new Scanner(System.in);
          char type;
          System.out.println("(E) Economy  - 50 TL");
          System.out.println("(M) Midsize  - 70 TL");
          System.out.println("(F) Fullsize - 100 TL");
          do{
              System.out.println("Enter the car type (E/M/F) : ");
              type = input.next().charAt(0);
              type = Character.toUpperCase(type);
          } while (type != 'E' &amp;&amp; type != 'M' &amp;&amp; type != 'F' ); //I tried to define condition with "||" operator,didn't work.
  
  
          switch(type) {
              case 'E' : ;return "Economy";             
              case 'M' : return "Midsize";
              case 'F' : return "Fullsize";
              default : return " ";
  
          }
  
  
      }
  </code></pre>
  
  <p>How can I print out only return value of this method ? Should I add System.out.println("Car type is ...) part in promptForCarType()?</p>