Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Random

Everytime i try to compile this it says doesn't recognise nextInt()
does anyone see any problems i don't
thanx

import java.util.Random;
import java.io.*;
public class Random
{
private void fillArray(int numInts, int largestInt)
{
int myArray [] = new int[numInts];
Random randGen = new Random();
numInts = 100;
largestInt = 100;

for (int loop = 0; loop < myArray.length; loop++)
{
myArray[loop] = randGen.nextInt(largestInt) + 1;
}
}
}
[576 byte] By [stormswimmer] at [2007-11-11 8:09:28]
# 1 Re: Random
You need to change the name of your class. It is looking for nextInt() inside of your code instead of Java's Random class.
srekcus at 2007-11-11 22:36:23 >