import java.util.Random; public class Demo { public static void main(String... args) { int[] arr = new int[] { 10, 30, 45, 60, 78, 99, 120, 140, 180, 200}; System.out.print("Random number from the array = "+arr[new Random().nextInt(arr.length)]); } }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more