+ 1

Please help me😢.I am in trouble of the java program about "Random" and "boolean" and "Array"

import java.util.Random; public class Test { public static void main(String[] args) { int[] nums = new int[10]; boolean []a=new boolean[n]; Random ran = new Random(); for(int i=0;i<10;i++){ nums[i] = ran.nextInt(10); do{ a[nums[i]]; } while(a[nums[i]]); a[nums[i]]=true; System.out.println(nums[i]); } } }

30th Jun 2018, 12:46 PM
Hunt
Hunt - avatar
3 odpowiedzi
+ 2
::loop is not seen meaningful (purpose):: the variable n is not declared
30th Jun 2018, 1:23 PM
Nitish kumar jha
Nitish kumar jha - avatar
+ 1
Start with save your code in "Code Playground" section and post here his link
30th Jun 2018, 12:55 PM
KrOW
KrOW - avatar
0
Thank you!
30th Jun 2018, 2:30 PM
Hunt
Hunt - avatar