public class stacktest { public static void main(String[]args){ DoubleStack stacks = new DoubleStack(); int x = 0; boolean ok = true; while(x < 5){ if(ok){ stacks.pushA(x); ok = false; }else{ stacks.pushB(x); ok = true; } } System.out.println(stacks.topA()); } }