The String asd prints double before asking the input for switcher, I feel hopeless now. I want the string "asd"to only print once but in my case in prints twice, my guess would be an error or looping, sorry I'm very new here and into programming
public class FruitBasket {
static String option;
static String choice1;
static int catcher;
static int counter1 = 1;
static int counter = 0;
static String eater = "e";
static Scanner sc = new Scanner(System.in);
static Stack<String> basket = new Stack();
static String switcher;
public static void main(String[] args) {
catching();
}
static void catching(){
System.out.println("Catch and eat any of these fruits: " + "'apple', 'orange', 'mango', 'guava'" );
System.out.println("A apple, O orange, M mango, G guava");
System.out.print("How many fruits would you like to catch? ");
catcher = sc.nextInt();
switches();
}
static void switches(){
while(counter1 < catcher) {
String asd = "Fruit " + counter1 + " of " + catcher + ":";
System.out.print(asd);
switcher = sc.nextLine();
switch (switcher) {
case "a":
basket.push("apple");
counter++;
counter1++;
break;