Would you please help ne. I am trying to read from an array but I keep
getting an error (Variable not defined. here is the piece of code please
help.
{StringTokenizer tokens;
tokens = new StringTokenizer(textLiner)
teamName = tokens.nextToken();
points = Integer.parsInt(tokens.nextToken());
premiership t[] = new Premiership[20];
int i;
for (i=0; i<t.length;i++);
{
t[i] = new Premiership(teamname,points);
t[i].teamName = teamName;
t[i].points = points;
}
David Rabinowitz - 18 Nov 2003 09:10 GMT
Try this:
StringTokenizer tokens;
tokens = new StringTokenizer(textLiner)
String teamName = tokens.nextToken();
<--------------
int points = Integer.parseInt(tokens.nextToken());
<--------------
Premiership t[] = new Premiership[20];
<--------------
int i;
for (i=0; i<t.length;i++);
{
t[i] = new Premiership(teamname,points);
t[i].teamName = teamName;
t[i].points = points;
}
also, how does it relates to security ?
David
> Would you please help ne. I am trying to read from an array but I keep
> getting an error (Variable not defined. here is the piece of code please
[quoted text clipped - 13 lines]
> t[i].points = points;
> }
David Postill - 18 Nov 2003 09:28 GMT
| Would you please help ne. I am trying to read from an array but I keep
| getting an error (Variable not defined. here is the piece of code please
[quoted text clipped - 4 lines]
| teamName = tokens.nextToken();
| points = Integer.parsInt(tokens.nextToken());
^^^^^^^
Integer.parseInt()
| premiership t[] = new Premiership[20];
| int i;
[quoted text clipped - 4 lines]
| t[i].points = points;
| }
i<davidp />
- --
David Postill