I wrote the following class:
public class Hello {
public static void showMoney(){
System.out.println("Money: " + money);
}
public static void main(String[] args){
int money = 1000;
showMoney();
}
}
I Want to see my money with showMoney() function but showMoney() function cannot recognize my money variable in the main method. Is there any way to do it properly?
Thank you.
Sorry for dumb question since I'm rookie in Programming.
moneyas an argument toshowMoney.