Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What does "int n=sc.nextInt ()" mean in java?
What does "int n=sc.nextInt ()" mean in java?
Your code is incomplete, right?

There should be a java.util.scanner sc = newjava.util.scanner (system.in) before;

In ...

Int n=sc.nextInt () means to get keyboard input:

If this line is executed, the program will pause, wait for you to enter it at the console, and then assign the input integer value to the integer variable n.