How to use long

I don.t know how to take input of long from the user. Please help me with the syntax of scanner.

Scanner scn = new Scanner(System.in);
Make sure you’ve imported java.util.Scanner in the beginning.
For long variables, just use
long var = scn.nextLong();

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.