What's the problem with this code? The output is empty. Can anyone help?
public class MyStack { ArrayList<Integer> stack; MyStack(){ stack = new ArrayList<>(); } public void reverseEven() { System.out.print("\nReverse Even: "); for(int i : stack) { if(i % 2 == 0) System.out.printf("%d", i); } } public void reverseOdd() { System.out.print("\nReverse Odd: "); for(int i : stack) { if(i % 2 == 1) System.out.printf("%d", i); } } } public class Main { static MyStack myStack; public static void main(String[] args) { boolean isRepeat = true; int size = 0, choice = 0, num; Scanner console = new Scanner(System.in); System.out.print("Enter Size of Array: "); size = console.nextInt(); System.out.print("Input Numbers: "); num = console.nextInt(); myStack = new MyStack(); while (isRepeat) { System.out.println("\n\t-----TRANSACTION OPTIONS-----"); System.out.println("\t[1]Reverse Even"); System.out.println("\t[2]Reverse Odd"); System.out.println("\t[3]Exit"); System.out.print("\nEnter Choice: "); choice = console.nextInt(); switch(choice) { case 1: myStack.reverseEven(); break; case 2: myStack.reverseOdd(); break; case 3: System.out.println("Thank you"); isRepeat = false; break; default: System.out.println("Invalid Option! Try Again."); break; } } } } Enter Size of Array: 5 Input Numbers: 12345 -----TRANSACTION OPTIONS----- [1]Reverse Even [2]Reverse Odd [3]Exit Enter Choice: 1 Reverse Even: