Either make an object of Hello1
class and then access the method
Hello1 obj = new Hello1();
int returnValue = obj.amountOfItemInBank(50);
or declare both the variable bankTabs
and method amountOfItemInBank
as static
in Hello1
class and use Hello1.amountOfItemInBank(50);
as you did earlier.
Also, read more here Understanding Class Members to clear your understanding and then you can solve the problem for once and for all
.