Results 1 to 2 of 2
Thread: help with compile errors
- 02-15-2011, 08:08 PM #1
Member
- Join Date
- Sep 2009
- Posts
- 3
- Rep Power
- 0
help with compile errors
heres my code:
/** * * @author Binny * */ public class Star
or
/**
*
* @author Binny
*
*/
public class Start {
public Start(int numberOfPlayers) {
List<Player> l = new List<Player>();
String[] playerNumber = {"Red", "Green", "Blue", "Yellow" ,"Orange", "Black", "Purple"};
for(int i = 0; i < numberOfPlayers; i++){
Player playerNumber[i] = new Player();
System.out.println(numberOfPlayers);
System.out.println(playerNumber[i]);
l.add(playerNumber[i]);
}
}
}
so the errors on line 11 says:
- Syntax error on token "i", delete this token
- Duplicate local variable playerNumber
- Type mismatch: cannot convert from Player to
Player[]
thanks in advance =)
- 02-15-2011, 08:14 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,608
- Rep Power
- 5
Similar Threads
-
First Java Program-Compile Errors (errors are posted)-simple GUI
By cc11rocks in forum AWT / SwingReplies: 4Last Post: 01-04-2011, 12:36 AM -
compile errors (how do I fix)
By rhythmiccycle in forum New To JavaReplies: 4Last Post: 01-03-2011, 10:33 PM -
Compile Errors and need to add a second static
By lk1001 in forum New To JavaReplies: 5Last Post: 03-04-2010, 11:58 PM -
Help with Compile time errors
By bri1547 in forum New To JavaReplies: 2Last Post: 08-24-2008, 11:22 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks