static int B,H;
static boolean flag = true;
static {
Scanner scan = new Scanner (System.in);
B = scan.nextInt();
H = scan.nextInt();
scan.close();
And
static int B,H;
static boolean flag = true;
static {
Scanner scan = new Scanner (System.in);
int B = scan.nextInt();
int H = scan.nextInt();
scan.close();
Why has these two functions different output for B and H? What's the difference with and without defining an int before B and H?