I am trying to use
Thread to generate some random numbers and I got some compilation errors:
.\CustomizedRandomNumGenerator.java:6: cannot resolve symbol
symbol : variable start
location: class CustomizedRandomNumGeneratorService
service = new CustomizedRandomNumGeneratorService().start;
^
.\CustomizedRandomNumGenerator.java:18: cannot resolve symbol
symbol : variable ranNum
location: class CustomizedRandomNumGenerator
return ranNum;
I have a main program that is supposed to display 5 random numbers:
The RandomNumberGenerator is an interface with a getRandom(); method to be implemented:
The CustomizedRandomNumGenerator implements the RandomNumberGenerator and starts a thread in the getRandom(); method. And it is the class where compilation errors occurred.
The code in the CustomizedRandomNumGeneratorService looks like: