0
Can anyone help me here? Why doesnt hi 5 doesnt get executed
3 ответов
+ 2
public class Program
{
    static int balance = 1500;
    static void showBalance(){
        System.out.println(balance);
    }
    static void depositAmount(int addB){
        balance += addB;
        System.out.println(balance);     
    }
    public static void main(String[] args) {
        showBalance();
        depositAmount(300);        
    }
}
+ 2
ref2.depositamount(9); // to execute it "hi 5"
+ 1
Thank you and I wish to correct you   I think that was a static method and now the present code is right
Thanks for the insights



