Here is my code. it is a simple console application intended to get me familiar with object use. `package okei; import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner listen = new Scanner(System.in);
Arg dec = new Arg();
String answer = "";
int howmuch;
Boolean a = true;
while(a)
{
System.out.println("Drink, Fill, or Look?");
answer = listen.nextLine();
switch (answer)
{
case "Drink":
System.out.println("How much?");
howmuch = listen.nextInt();
dec.drink(howmuch);
break;
case "Fill":
System.out.println("How much?");
howmuch = listen.nextInt();
dec.fill(howmuch);
break;
case "Look":
System.out.println(dec.look());
break;
case "Quit":
listen.close();
a=false;
break;
}
}
}
} `
Here is the ouptut Drink, Fill, or Look? Drink How much? 10 Drink, Fill, or Look? Drink, Fill, or Look?
Why is Drink, Fill, or Look being executed twice?