wayne brandon wrote:
does it have to captured in another variable?
i tried this:
but it says its ignored
Daniel Andersson wrote:Calling methods from another class is confusing to me.
I have this code in one class:
The code at line 17 is what I have problems with.
Where MainActivity is the other class. How can I call the method updateCountDownText() without making anything static?
Campbell Ritchie wrote:That looks good but you should be able to use something on the lines of b = !b; to reduce lines 18‑23 to one statement.
Ansamana Sankarray wrote:. . . my own solution . . .
What do lines 26‑28 mean?
Ben Hutchenson wrote:
Ansamana Sankarray wrote:Class MainProgram and Flashcard are not in the same package and you're creating an instance of Flashcard without importing, plus class Flashcard is on the default package and you can't import from the default package.
I updated the three files so the package name matches - two had a lower case F. Just to be clear, now that they're all under the same package there will be no importing of anything required, right?
Paul Folder wrote:Hello,
Some observations in addition to what others have posted:
-Reading the description of GuessAndWin confused me. I thought guessing a number and guessing a finger is two completely separate things and didn't understand the connection and why both are needed. Isn't each player just guessing 2 numbers; an own and a sum?
-All of the methods in GuessAndWin are static at the moment.
-In main(), lines 139-140, two new Player objects are instantiated. Their names are then handed over to playGame(), but there, on lines 33-34 two new Player objects are instantiated again. Consider either handing over the Player objects themselves to playGame(), or instantiating them only in playGame(). Perhaps there will be a use for setters in Player again.
-Some of the printed text could be stored in constants. I see lots of "line breaks" ("-----------------------------------------").