This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I am copying the program from Chapter 14 from HeadFirstJava;QuizCardBuilder.java. But there is an error when I am writting program on ArryaList.
Here is a program :
Following lines where I found Error: 1) private ArrayList<QuizCard> cardList; 2) cardList = new ArrayList<QuizCard>; 3) QuizCard card = new QuizCard(question.getText(),answer.getText()); cardList.add(card);
Please help me to find out error. where I went wrong.
[edit - added code tags] [ August 02, 2007: Message edited by: Fred Rosenberger ]
I added code tags to your post to make it easier to read. Please use them yourself in the future when you post source code.
Now, what exactly is the error you are getting, and what version of Java are you using? I'm guessing it may be because you have 1.4, and this code uses features introduced in 1.5, but without those error messages, it's just a stab in the dark.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Jan 25, 2007
Well I am using 5.0 version. I am using eclipse to complie the code .. I am unable to compile the code