SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args)
  6.     {
  7.         Integer[] arr = new Integer[20];
  8.         Random generator = new Random();
  9.  
  10.         for (int i = 0 ; i < arr.length; ++i) {
  11.             arr[i] =(generator.nextInt(10) + 1);
  12.         }
  13.  
  14.         List<Integer> arrayList = Arrays.asList(arr);
  15.         System.out.println("Wystapienia: ");
  16.  
  17.         for (int i = 1; i <= 10; ++i) {
  18.             System.out.print(i + "-" + Collections.frequency(arrayList, i) + " ");
  19.         }
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top