title: I want to accept full name of manager in my organization java app...i tried using sc.nextLine(); but it is showing InputMisMatch error
body: <p>Below is my code focus area is case 1 and case 2. please suggest some simple ways to accept full name considering I am a beginner:</p>
  <pre><code>package Tester;
  
  import java.util.Scanner;
  
  import com.app.org.Emp;
  import com.app.org.Mgr;
  import com.app.org.Worker;
  
  public class TestOrganization {
      
      public static void main(String args[]) {
          Scanner sc = new Scanner(System.in);
          System.out.println(&quot;How many people you want to recruit&quot;);
          Emp[] org = new Emp[sc.nextInt()]; //holder array ...its not a emp object...its array type of object
          boolean exit = false;
          int index = 0;
          while(!exit) {
          System.out.println(&quot;Options\n&quot;+&quot;1.Hire Manager\n&quot;+&quot;2.Hire Worker\n&quot;+&quot;3.Display information of all employees\n&quot;
                  + &quot;4.Update Performance Bonus or Hourly Rate&quot;);
          switch (sc.nextInt()) {
          case 1:{
              if(index&lt;org.length &amp;&amp; index&gt;=0) {
              System.out.println(&quot;Manager Details:  id,  name,  deptId, basic,  performBonus&quot;);
              org[index++] = new Mgr(sc.nextInt(),sc.nextLine(),sc.next(),sc.nextDouble(),sc.nextInt());
              }else {
                  System.out.println(&quot;Invalid!!! index&quot;);
              }
              break;
          }
          case 2:{
              if(index&lt;org.length &amp;&amp; index&gt;=0) {
                  System.out.println(&quot;Worker Details: id, name, deptId, basic, hw, hr&quot;);
                  org[index++] = new Worker(sc.nextInt(),sc.nextLine(),sc.next(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble());
              }else System.out.println(&quot;invalid!!! index&quot;);
              break;
          }
          case 3:{
              System.out.println(&quot;Employees Details&quot;);
              for (Emp e : org) {
                  if(e!=null)
                  System.out.println(e);
              }
              
          }
  </code></pre>
  <p>input:
  How many people you want to recruit
  5
  Options
  1.Hire Manager
  2.Hire Worker
  3.Display information of all employees
  4.Update Performance Bonus or Hourly Rate
  1
  Manager Details:  id,  name,  deptId, basic,  performBonus
  101
  samarth shukla</p>