you can call a void method like any other method, except that you don’t have to do anything with the return value because there isn’t one.
case 2:
listBasket(basket);
break;
for your third case, you have to pass in both a double
and an ArrayList
if you want to pass 0
as your double
, than you can just post a double
literal.
case 3:
/* if you don't want totalCost to go out of scope right away,
* declare it above the switch statement */
double totalCost = CalcTotalCost(0.0, basket);
...
break;
solved Syntax error in calling a method java (newbie) [closed]