2. Write a Java application which tests the random numbergeneration abilities of Java. Random number generation is explainedbelow.Your application should simulate rolling a pair of dice somenumber of times. Use a JOptionPane to ask the user how many timesthe dice should be rolled. Each dice roll can be a value between 1and 6 so rolling 2 dice will result in values between 2 and 12.You need to generate a random number between 1 and 6 to simulaterolling each dice. Keep track of the result of each roll using anarray that is indexed by the sum of the roll of the two dice.Output your result in a table which shows each value (ie. 2 12)and the number of times that value was rolled.