public static void initialval()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter your:");
System.out.println("i) Name ");
String name = sc.nextLine();
System.out.println("ii) Account number");
long accno = sc.nextInt();
System.out.println("iii) Type of account");
String typeofacc = sc.nextLine();
System.out.println("iv) Balance");
int bal = sc.nextInt();
sc.close();
}
the output is
Enter your:
i) Name
Dhruv
ii) Account number
123
iii) Type of account
iv) Balance
5000
As you can see the type of account doesn't execute