Check my code I am getting run time error

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
Scanner s = new Scanner(System.in);
int d = s.nextInt();
int c = 0;
for (int i = n; i >=1; i = i / 10) {
if (i % 10== d)
c++;
}
System.out.println©;

}

}

Hi Anshuman,
You don’t need to make two scanner variable.

please justify why i was getting error for that.

Hi Anshuman,
You were getting error for that because compiler get confuse which scanner it have to use for taking input.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.