What is the correct syntax to get Integers from scanner if they meet some criteria and assign to arrayList? It should loop and get the inputs until we insert "-1". It stops then I insert "q" but I need it to work with certain integer.
Scanner sc = new Scanner(System.in);
while (-99 !== sc.nextLine() && sc.hasNextInt())
{
//do something Whi
}
int?