Hi
I want to create an array by declaring a class, instead of a variable type int double etc. I have created a program. I have posted it below. I'm trying to set up an array with class Ply here, but the java compiler is giving any error message. I can not figure out the error. Can any one help with this.
Code:
public class MainClass
{
public static void main()
{
Scanner in = new Scanner(System.in);
Ply[] myTeam = new Ply[11];
for(int i = 0; i < myTeam.length; i++)
{
myTeam[i] = i + 1;
Ply[] myTeam = {1,2,3,4,5,6,7,8,9,10,11};
}
}
}
Bookmarks