Anybody know where I can get a whole lot of Java exercises? I feel that's the biggest part missing from my studying: The hands-on experience. There's a lot of books out there, but there's not enough hands-on exercises... the books tend to scrimp. I'd like to hit the following areas heavily with exercises:
REGEX: searching with Pattern/Matcher, Searching with Scanner, Using Scanner for tokenizing, Using String.split() for tokenizing
THREADS: use with synchronization, use with wait/notify/notifyALL
CALENDAR EXERCISES: Use of Calendar, Date, DateFormat, and Locales in useful situations.
INNER CLASSES: Just general exercise practice with static nested classes and inner classes.
OBJECT ORIENTED: General OO type exercises putting inheritance to work along with how static methods play its part here.
JAVA/JAVAC: Exercises in compiling and running classes from various different directories with different packages, etc.
COLLECTIONS: Exercises in the usage of various types of collections and arrays and which would be most useful for what.
ARRAY and COLLECTIONS SORT/SEARCH: This is a major weak area of mine. I'd like to tackle exercises in how to use binarySearch, Comparable, Comparators for both Array and Collection.
MAPS: Also, a very weak area of mine. Need practice using maps with key/value pairings. Also, I need practice with overriding equals and hashcode.
There's probably more that will come to me, but these are off the top of my head. I've been having a hard time finding a book or website with nothing but exercises with clues/answers. Help would be appreciated!
Joined: Nov 09, 2007
Anybody know of a Java workbook out there with just exercises? I'm actually preparing for the Java Programmer certification and I learn best by DOING. I've got theory coming out the ears and I need to learn in a practical way. Would appreciate any kind of recommendation.
I don't know of any workbooks, but each chapter of Deitel & Deitel's Java: How to Program has a load of questions after each chapter that will cover all these topics. The book is great, but comes with a hefty pricetag up to $100 US. The Java tutorials at Sun usually have questions at the end of each section too IIRC.
You could also peruse the Programming Puzzles forum on this very site.
Agree with Brandt Charles. There are second-hand copies of Deitel and Deitel on Amazon.com from $39.99 + $3.99 postage. That is the 6th edition, and there is now a 7th edition, but I don't think a beginner will notice the difference between the two editions.
There are copies of the 5th edition for a lot less, but I think that is now best regarded as out of date.
Joined: Nov 09, 2007
Hey Campbell, thanks for that bit of advice! $100 is just way too much. But $40 is much more reasonable. I just bought one of those from Amazon. It's used, but it's like new with the cd still sealed and everything. I'm heard some good things about this book and I'm hoping it has a lot of good exercises to do. Anyway, thanks again!
This free, excellent book on learning Java from the ground up is well worth your time. The author writes,"The fourth edition is tailored to help students prepare for the Computer Science AP Exam," Book Title "Think Like A Computer Scientist in Java" By Allen B. Downey
Why spend money when there is an overwhelming resource of free University and Professional level books out there not to mention the Sun site as well. Check it out. I've got more Java books for free than I need right now on the computer.