Ok, I've got my first java class now and I know the concepts of what to do, just not how to implement the java code. Can someone help me out with a quick question? I need to Create a class called Payment_Card_DB with an instance variable which is an array of Payment_Cards. This arrays should be initialized with 5 debit and 5 credit cards when an instance of Payment_Card_DB is created.
I need to know how to write the damn array correctly. This is what I did, and have no idea why it doesn't work.
String paymentCards[] = new String[10];
paymentCards[0] = new String("Debit Ron");
paymentCards[1] = new String("DebitMark");
paymentCards[2] = new String("Debit Doug");
paymentCards[3] = new String("Debit Brad");
paymentCards[4] = new String("Debit Matt");
paymentCards[5] = new String("Credit Mike");
paymentCards[6] = new String("Credit Jim");
paymentCards[7] = new String("Credit Fred");
paymentCards[8] = new String("Credit Tom");
paymentCards[9] = new String("Credit Bob");
Thanks
I need to know how to write the damn array correctly. This is what I did, and have no idea why it doesn't work.
String paymentCards[] = new String[10];
paymentCards[0] = new String("Debit Ron");
paymentCards[1] = new String("DebitMark");
paymentCards[2] = new String("Debit Doug");
paymentCards[3] = new String("Debit Brad");
paymentCards[4] = new String("Debit Matt");
paymentCards[5] = new String("Credit Mike");
paymentCards[6] = new String("Credit Jim");
paymentCards[7] = new String("Credit Fred");
paymentCards[8] = new String("Credit Tom");
paymentCards[9] = new String("Credit Bob");
Thanks