SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.company;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Random;
  5.  
  6. public class Main {
  7.  
  8.     public static void main(String[] args) {
  9.         ArrayList<Piki> pikis = new ArrayList<>();
  10.         Random rnd = new Random(System.currentTimeMillis());
  11.         for (int i = 0; i < 100; i++) {
  12.             Piki piki = new Piki("Piki " + i, 1 + rnd.nextInt(100), 100 + rnd.nextInt(1000));
  13.             pikis.add(i, piki);
  14.         }
  15.         for (int i = 0; i < 100; i++) {
  16.             int y = pikis.get(i).getLength();
  17.             for (int j = 0; j <= 100; j++) {
  18.                 if (y < pikis.get(j).getLength()) {
  19.                     pikis.get(j).setLength(y);
  20.                 }
  21.                 i++;
  22.             }
  23.             for (int o = 0; o < 100; o++) {
  24.                 System.out.println(pikis.get(o).getLength());
  25.             }
  26.         }
  27.     }
  28. }
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