1. Home
  2. Computing & Technology
  3. Java

Beginner Level

These exercises and questions target programmers who are new to Java. They focus on the basic building blocks of Java's syntax e.g., data types, loops, conditions, arrays, methods, objects, and so on.
Common Runtime Error
See if you can debug a piece of code that produces one of the most fundamental Java runtime errors.
Playing With Wrappers
Play around with wrapper classes in this simple exercise.
Literal Loop
Can you write loops using hexadecimal and octal literals?
Converting Strings
Test your ability to convert Strings to numbers.
Counting Rabbits
Here's a idealistic way for counting rabbits – can you determine how many will exist after 20 generations?
The Infinite Loop
Can you rewrite this Java code so that there is no longer an infinite loop?
Breaking Out
Are you a fan of jumping out of loops? If so, where do you land after breaking out?
The Hailstone Sequence
A clever German mathematician created a simple formula that will produce what is sometimes known as the hailstone sequence. Can you write a program to display that sequence for a certain number?
Shifting Bits
How are you at shifting bits right and left?
Code Points
Try and discover which characters are represented by the Unicode code points.
Code Points (Part II)
Explore the characters produced by code points beyond the lower ranges.
Encoded First Line
I have cunningly encoded a first line from an Iain Banks book. Can you write a program to decode it?
Uncoded Line
This time rather than decoding a line, it's time to encode one.
The Collatz Theory
The hailstone sequence is back again. This program is designed to test Lothar Collatz's unproven theory.
Going Around and Around
Have you ever wanted to put your programs into a spin? Here's your chance.
Odd Magic Squares
Turtles, magic and squares will conspire to test your logic in this exercise.
Doubly-Even Magic Squares
Take the odd magic squares program one step further with another test of your programming logic.
Build a Simple Robocode Robot
It's time for some robot carnage.
Explore Java
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Java
  4. Programming Exercises
  5. Beginner Level

©2009 About.com, a part of The New York Times Company.

All rights reserved.