Java Static Initializer Block

  • + 1 comment

    I tried doing it that way but it went wrong, so I had to take the:

    Scanner scan = new Scanner(System.in);
    
    B = scan.nextInt();
    
    H = scan.nextInt();
    

    out of the block.

    Why is it?