You are here:

Focus on Java

Recent Answers

2009-11-22 Java - Max integer value:

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

2009-11-20 Java - Max integer value:

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

2009-11-19 Java - Java Fundementals Book program 5-4:

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()

2009-11-19 Java - Displaying Bitmaps:

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

2009-11-18 Java - SCJP:

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

Categories

Browse Alphabetically

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