import java.util.Scanner;
class Student1{
    int a;
    String b;
    void get(int c, String d){
        a = c;
        b = d;
    }
    void show(){
        System.out.print("Id is " + a +"\n");
        System.out.print("Name is " + b);
    }
    public static void main(String args[]){
        Scanner one = new Scanner(System.in);
        System.out.print("Enter Id");
        int e = one.nextInt();
        System.out.print("Enter Your Name");
        String f = one.nextLine();
        Student1 s = new Student1();
        s.get(e ,f);
        s.show();
    }
}
when the program is executed it only asks for Id after that it shows result it never asks for Name
 
     
     
     
     
     
    