public static JohnnyCard getJohnnyCard(int n) { switch (n) { case 0: return new JohnnyCard(); case 1: JohnnyCard J1 = new JohnnyCard(); J1.setBalance(499); J1.setLocked(true); J1.setTransactions(new JohnnyTransaction[5]); default: break; } throw new java.util.NoSuchElementException(); }
public static JohnnyMachine getJohnnyMachine(int n) { switch (n) { case 0: return new JohnnyMachine(); case 1: JohnnyMachine J2 = new JohnnyMachine(); JohnnyCard C2 = new JohnnyCard(); C2.setJohnnyCardId(10000); JohnnyBank B2 = new JohnnyBank(); B2.setBalance(200000); B2.setBankAccountId(10000); B2.initialiseJohnnyCard(C2); J2.setJohnnyBank(B2); J2.setJohnnyCard(C2); return J2; default: break; } throw new java.util.NoSuchElementException(); }