title: User input values in the global variables
body: <p>I declared two variables in the main class of Java which I made public. Please see the code below.</p>
  
  <pre><code>java.util.Scanner;
  
  public class NestedExample {
  
      public int a,b,c;
  
      public static void main (String args[])
      {
          System.out.println("Please enter the first value");
  
          Scanner d = new Scanner(System.in);
          int a = d.nextInt();
  
          System.out.println("Please enter the second value");
  
          Scanner e = new Scanner(System.in);
          int b = e.nextInt();    
  
      }    
  }
  </code></pre>
  
  <p>Could you please tell me if the code is correct as, it is showing an error in the Scanner command.</p>
  
  <p>Regards,
  Saurabh</p>