+ 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]); } } }
3 Answers
+ 2
::loop is not seen meaningful (purpose)::
the variable n is not declared
+ 1
Start with save your code in "Code Playground" section and post here his link
0
Thank you!