When I enter 42 for the seed value, it provides a certain sequence of numbers and reproduces the same ones every time the program is used. But the sequence of numbers in my program doesn't match up with the sequence of numbers in another program. I need to figure out how to make both of them provide the same output of random numbers when both seed values are set to 42. Is this the correct format for getting a seed value from the user? What could be causing the numbers to not match up? Thanks for the help.
public class SampleTest {
public static void main(String[] args) {
System.out.println("Please enter a seed value: ");
Scanner in = new Scanner(System.in);
seed = in.nextInt();
Random ranGen = new Random(seed);