Here is the error

[IMG]http://i1199.photobucket.com/albums/aa465/aaron55494/compileerror.png?t=1311972955[/IMG]

and here is the code that i'm working on

public String getKillMessage(String player) {
        String[][] selection = {{"Congratulations, you have defeated ", "},
                {"Congratulations, you have ", "}};
		
        int index = (int) Math.floor(Math.random() * 9);
        return selection[index][0] + player + selection[index][1];
    }

Any help is appreciated!

Recommended Answers

All 2 Replies

It states Unclosed String Literal. Check your String array initialization.

Fixed. Thank you very much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.