The Java Jungle
Compilation of java study guides, challenges, and sample code
Core Skills List With Exercises
The following items represent a core set of java skills for an introductory course. Tackle the problems under each area for practice!
- Essential syntax; primitive variables
- Essential operators: + - * / % = == <= <= !=
- Calling methods on existing objects
- Writing simple methods and calling them
- Writing classes with class member variables and methods
- Creating and storing objects: constructors and 'new'
- Scope: member and local variables
- Static versus instance variables and methods
- Gathering user input and using the data
- Basic conditional statements - if() and switch()
- Using classes in the java language library through the Java API
- Looping blocks: for() and while()
- Arrays: creation and manipulation
- Implementing and designing basic algorithms
Work through this fantastic object creation in-code practice set
Overview of user input principles
Tackle this array practice in-code exercise set
Arrays can hold objects, too. Practice with guided coding problems here
Algorithm practice concepts and challenges
Other practice
Don't forget that checkpoint 2 tasks are great practice on arrays, looping, conditionals, and user input:
These are "extra" topics that are basically part of a core understanding of Java but rely on mastery of the above skills to successfuly implement.
- Data Structures: stacks, queues, and maps
- Data Structures in-code practice
-
Practice challenges related to Linked Lists. These are the same as the challenges included at the end of the in-code practice file linked above
// STRAIGHTFORWARD CHALLENGE: create a new LinkedList
// and store it in a var named secondList;
// Fill that list with String objects that
// are a set of four careers you would disliked the most
// THEN remove the items and print them out, by only remove
// items in even-numbered index positions
// --> YOUR CODE HERE <--
// INTERMEDIATE CHALLENGE: Linked lists can store any type of
// object, but not primitive values like int and double
// But we have Integer objects that act just like ints
// and we can store those in LinkedLists
// Write a for() loop that stores numbers counting by 10
// from 1 to one million in a linked list of Integers
// note we can write things like
// Integer i =3;
// and we can print these by sending them to println like normal
// System.out.println(i);
// The display to the user the numbers in 4 positions in the list
// --> YOUR CODE HERE <--
// TRICKY CHALLENGE: Create a linked list of Strings that the user
// enters. Tell the user to enter -9 when they are done entering
// items in the list. THEN allow the user to print the list
// out by tapping "enter" over and over again until the list is empty
// then display "no more items"
// This is hard to do and you'll need to read over methods and maybe
// even use a ListIterator which has nice methods for
// looping over a list. Get a ListIterator with listIterator();
- Writing and reading files
- Approaches to sorting and searching