How do I get the variable of one method to be a variable in another method for Java?

前端 未结 4 848
南笙
南笙 2021-01-28 22:44

Here I am trying to have my \'cash\' variable from the Player method be included in an equation in my wagerBet() method. Currently Eclipse is telling me that variable \'cash\' c

4条回答
  •  遇见更好的自我
    2021-01-28 23:23

    There is only one real problem. To understand what static is.

    Basic approach, until you are good enough, is to NOT use static at all. Remove it in all cases instead of "main" (you have to keep it there).

提交回复
热议问题