Hello. 

I want to write what I developed in the morning just not with arrays: 

import java.util.Scanner;

public class Two {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);  
    // ... 
    while (true) {
      System.out.print("Type: "); 
      String line = input.nextLine(); 
      if (line.equals("bye"))
        break; 
      int number = Integer.parseInt(line); 
      // ... 
    }
    // ... 
  }
}

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> import java.util.ArrayList; 
> ArrayList<Integer> a
> a
null
> a = new ArrayList<Integer>()
[]
> a
[]
> a.add(3)
true
> a
[3]
> a.add(5)
true
> a
[3, 5]
> a.add(-2)
true
> a
[3, 5, -2]
> a.size()
3
> a.get(1)
5


import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;

public class Two {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);  
    ArrayList<Integer> a = new ArrayList<Integer>(); 
    while (true) {
      System.out.print("Type: "); 
      String line = input.nextLine(); 
      if (line.equals("bye"))
        break; 
      int number = Integer.parseInt(line); 
      a.add(number); 
      System.out.println( a ); 
    }
    Collections.sort(a);  
    System.out.println( a );     
  }
}

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run Two
Type:  [DrJava Input Box]
[4]
Type:  [DrJava Input Box]
[4, 6]
Type:  [DrJava Input Box]
[4, 6, 2]
Type:  [DrJava Input Box]
[4, 6, 2, 3]
Type:  [DrJava Input Box]
[4, 6, 2, 3, 5]
Type:  [DrJava Input Box]
[4, 6, 2, 3, 5, 1]
Type:  [DrJava Input Box]
[1, 2, 3, 4, 5, 6]


https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html

https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html

--

  Ankney, Garrett
  Berry-Simms, Khalea
  Clark, Daniel
  Cooper, Keiland
  Cotter, Ryan
  Gan, Kang Jie
  Hay, Stuart
  He, Kefei
  Hiraga, Misato
  Hu, Tao
  Jing, Elise
  Kaefer, John
? Kim, Jinsu
  Kowala, Katherine
  Liu, Li
  Matlock, Noah
  Navarro, Nicholas
  Nieves, Rafael
? O'dell, Taylor
  Parker, Patrick
  Pena, Jillian
  Qian, Jiang
? Reba, Christopher
  Ruiz, Daniel
? Salazar, Luis
  Shen, Bihan
  Stamets, Justin
  Wang, Iris
  Wang, Yibo

--