The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Anyone would like to help me? I really need your help???

Task:
1.) Write a Java class that generates a random integer (between 1 and 250). Call the
class GenKeys. GenKeys should have a least one method that returns the integer
random number. Gen Keys should not have a main method.

2.) Write a Java Program called MainProg that does have a main method. This class
should create an instance of GenKeys and use it to randomly generate integers.
We will call these integers keys.

3.) MainProg should write keys, each on their own line, in a file called “keys.txt”.
Ultimately your program should generate and write to file 500 keys.

4.) MainProg should then read all of the keys from “keys.txt”, and store them in an
array, removing any duplicates. (In other words if the number 55 is generated
twice, only one of these 55’s should be added to the array). Note that your final
array will contain less than 500 keys. Now, write the remaining keys into a file
called “sorted.txt”, one key per line, with the smallest number on the first line
and the largest file on the last line.