How to get Input from User using scanner class In Java?

The problem that I am facing here is in the execution

import java.util.Scanner;
public class a
{
public static void main()
{
    Scanner b = new Scanner(System.in);
    System.out.println("Enter the integer");
    int c = b.nextInt();
    System.out.println("Enter the string");
    String d = b.nextLine();
    System.out.println();
    System.out.println(" The integer you entered is" + a);
    System.out.println(" The string you entered is "+b);
    }
}

Can anyone help me to rectify where I have done the mistake?

I read this article for my reference.

Thank you!

What does it do that you don’t want it to do, not do that you want it to, or what error message does it produce.