Could someone explain to me when I run this code, I don't get the Sysout statement until I enter my first keyboard input?
import java.util.Scanner;
public class test1{
static Scanner scan = new Scanner(System.in);
static int k = scan.nextInt();
public static void main(String[] args) {
setK();
System.out.println(" K is: " + k);
}
public static void setK(){
System.out.println("Please input K value");
k = scan.nextInt();
}
}