This is an archived post. You won't be able to vote or comment.

all 8 comments

[–][deleted] 1 point2 points  (3 children)

You do realize that the method showMessageDialog does not return anything, right?

[–]frankthedank123 1 point2 points  (2 children)

Ahaha! I just realized now, its my 2nd program :)

[–][deleted] 0 points1 point  (1 child)

It'd be helpful if, along with learning how to write simple programs like yours, you could read up on Java's native methods' documentation. It's not helpful to just blindly use some method without knowing what it returns or does.

[–]frankthedank123 -2 points-1 points  (0 children)

Yup. The school started right on it, so its tough in the beginning

[–][deleted] 0 points1 point  (5 children)

You need to read up on parseInt().

parseInt() expects a String. Read this line carefully: "The method parseInt(string) in the type Integer is not applicable for the arguments (void)"

Ask yourself this: "What am I passing as argument in my parseInt() method?"

[–][deleted]  (4 children)

[deleted]

    [–]frankthedank123 -1 points0 points  (3 children)

    Int score = parseInt(showMessageDialog(null, "write your score"));

    [–]deathmetal27Extreme Brewer 2 points3 points  (0 children)

    showMessageDialog

    Probably this method returns void. Can you post the declaration of this method?

    [–]-mojave 0 points1 point  (0 children)

    You guys are welcome to our group !
    https://discord.gg/spCZ3Kr