Answer the question
In order to leave comments, you need to log in
Why is NullPointerException [OOP] thrown?
There is a code in the 1st file (Main.java)
public void setGlory(long glory)
{
this.glory = glory;
}
Main m;
public Bank() throws InterruptedException, IOException
{
this.glory = Main.getGlory();
System.out.println("Your balance is: $"+money);
private void depositMoney() throws InterruptedException
{
for (int i = 0; i < 10; i++)
{
this.glory++;
System.out.println("Your glory is: ★"+glory);
Thread.sleep(1000);
}
m.setGlory(glory);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question