Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class DemoList4 {
- public static void main(String[] args) {
- System.out.println("Demo de lista ordenada");
- Random random = new Random();
- List<Integer> lista1 = new List<Integer>();
- int num;
- System.out.printf("\nNumeros: ");
- for (int i = 0; i < 20; ++i) {
- num = random.nextInt(1000);
- System.out.printf("%d ", num);
- lista1.AddInOrder(num);
- }
- System.out.printf("\n\nLista1: ");
- for (int n : lista1) {
- System.out.printf("%d ", n);
- }
- }
- }
Add Comment
Please, Sign In to add comment