title: Need help to resolve the issue ... not getting desired output. I would like to input two bank details and want output for the same
body: <p>I am new to Java and stared learning things of my own, however I need some help to resolve the issue I am facing... let me know where I am wrong with my code.</p>
  
  <p>My output is displaying like </p>
  
  <pre><code>Input -
  Enter Bank Name: a
  Enter Bank Account number: 1
  Output - 
  Bank Name: null
  Bank Account Number: 0
  </code></pre>
  
  <p>Why it is not displaying bank name as 'a' and account number as '1'. Kindly provide some help.</p>
  
  <pre><code>//Bank.java
  
  import java.util.Scanner;
  class Bank
  {
      String bank_name;
      int bank_account_number;
  
      void input_info()
      {
          Scanner input1 = new Scanner(System.in);
          System.out.print("Enter Bank Name: "); 
          String bank_name = input1.nextLine();
  
          Scanner input2 = new Scanner(System.in);
          System.out.print("Enter Bank Account number: ");
          int bank_account_number = input2.nextInt();
      }
  
      void display_info()
      {
          System.out.println("Bank Name: " +bank_name);
          System.out.println("Bank Account Number: " +bank_account_number);
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>//Display_bank_details.java
  
  class Display_bank_details
  {
      public static void main (String args[])
      {
          Bank details1 = new Bank();
          Bank details2 = new Bank();
  
          details1.input_info();
          details2.input_info();
  
          details1.display_info();
          details2.display_info();
      }
  
  }
  </code></pre>