Question: java code (20 Points) Write a program that stores positive random integers in an array. Get the element number(length of the array) from the user

java code
(20 Points) Write a program that stores positive random integers in an array. Get the element number(length of the array) from the user and fill this array randomly. The range is up to you. Your job is to write a method that finds and returns the next smallest positive integer considering the smallest element in this array. Show me your main method too. DO NOT USE ANY PRE DEFINED METHODS IN THE JAVA API. IF YOU DO, YOU WILL GET O FROM THIS QUESTION SAMPLE OUTPUT 1 The elements are: 15. 7. 74, 52, 97, 10, 69, 99, 85, 72) The next smallest integer is : 4 SAMPLE OUTPUT 2 The elements are: 164, 18, 84, 50, 70, 88, 18, 20, 83, 671 The next smallest integer is 1 17
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
