You are here:
First, if you are getting an OutOfMemoryError, you can try increasing the amount of RAM the JVM will use. By default the Java system will only use 90MB. To increase it run java with the -Xmx2G switch to
You can use long (instead of int), which has twice as many bits and a much bigger value (big enough to hold the number of milliseconds since the beginning of the universe several times over). If that is
You need a class Dice. That class has a single field current, it should be private. Add a method to get the value of this field. Add another method to change this value to a random one (current = new Random()
Its pretty easy to implement your own zoom. You can simply: float scale = ...; Point scaleCenter = ...; protected void paintComponent(Graphics g) { Graphics2D g2 = (Grphics2D)g; AffineTransform
You have: class Vehicle2 { int passengers; // number of passengers int fuelcap; // fuel capacity in gallons int mpg; // fuel consumption in miles per gallon } You can change this

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