The question is : Write an application that creates and prints a random phone number of the form XXX-XXX-XXXX. Include the dashes in the output. Do not let the first three digits contain an 8 or 9 (but don't be more restrictive than that), and make sure that the second set of three digits is not greater than 742. Hint: Think through the easiest way to construct the phone number. Each digit does not have to be determined separately.
I have done this so far lol :
import java.util.Random;
public class digits {
/**
* @param args
*/
public static void main(String[] args) {
int a;
Random s = new Random();
a = s.nextInt(30);
System.out.println(a);
// TODO Auto-generated method stub
}
}
So if any1 can help that would be great ...thanks.