Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package JavaBook;
- import java.util.*;
- public class ArrayLists {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- ArrayList<Integer> nums = new ArrayList<Integer>();
- for(int i = 0; i <= 9; i++){
- int n = Integer.parseInt(scan.nextLine());
- nums.add(n);
- }
- Collections.sort(nums);
- for(int i = 0; i < nums.size(); i++) {
- System.out.println(nums.get(i));
- }
- }
- }
- //Special Thanks to Marian
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement