static void compare(int a) {
Scanner sc= new Scanner(System.in);
int b= sc.nextInt();
i want to make int b to global variable.
in Python, i can initialize global variable in a function like this
def compare():
global b
b = 15
but in java adding static
static int b= sc.nextInt();
makes error, how should make this possible?