user298472
user298472

Reputation:

Call to pop failing in my java code

public void CardToPile() {
    waste.push(reserve.pop);
}

Upvotes: 0

Views: 139

Answers (2)

Carlos
Carlos

Reputation: 5455

public void CardToPile() {
        waste.push(reserve.pop()); //Here is the error
    }

You need to add the parens in order to call the method.

Upvotes: 7

Anzurio
Anzurio

Reputation: 17014

If by "not working" you mean that it does not compile, it might be because your call to reserve.pop seems incorrect. You might have meant reserve.pop().

Upvotes: 2

Related Questions