Advertisement
Guest User

Untitled

a guest
Mar 19th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import java.util.ArrayList;
  2.  
  3. public class Program {
  4.  
  5. int one, two;
  6.  
  7. Program ( int one, int two ) {
  8. this.one = one;
  9. this.two = two;
  10. }
  11.  
  12. public static void main(String[] args) {
  13.  
  14. ArrayList<Program> array = new ArrayList<Program>();
  15.  
  16. array.add(new Program(1,2));
  17. array.add(new Program(3,4));
  18. array.add(new Program(5,6));
  19. array.add(new Program(7,8));
  20. array.add(new Program(9,10));
  21.  
  22. int min = 0;
  23.  
  24. for ( Program i : array ) {
  25. if (i.one > min)
  26. min = i.one;
  27. System.out.println(i.one);
  28. }
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement