Scanner not working

Why is scanner not working in my code?
i.e= Scanner s=new Scanner(System.in);
int t=s.nextInt();<-error is showing in this line

@fazalrehan0_gmail.com,
Can you please share your complete code

@fazalrehan0_gmail.com,
Did you import the scanner class?