Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TurboLag

macrumors member
Original poster
Feb 24, 2004
85
0
Im trying to compile a simple program in BlueJ 2.01 and I get this error: cannot resolve symbol - class Scanner

//Program:
import java.util.Scanner;
import java.text.NumberFormat;

public class Deli
{
public static void main (String[] args)
{
final double OUNCES_PER_POUND = 16.0;

double pricePerPound;
double weightOunces;
double weight;
double totalPrice;

Scanner scan = new Scanner(System.in);

and so on...


Am I missing a library package?
 

iMeowbot

macrumors G3
Aug 30, 2003
8,634
0
Isn't Scanner a JDK 1.5 thing? Apple haven't made that version of the JDK available to the general public yet.
 

stoid

macrumors 601
TurboLag said:
How could I implement this program with the currenct JDK?

Code:
try{
    BufferedReader kbr = new BufferedReader( new InputStreamReader( System.in) );
    String userInput = kbr.readLine();
    //process userInput
} catch {(IOException e) {
    System.out.println("IO Error: " + e );
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.