i need some NetBeans help again!!!?

i need some NetBeans help again!!!?
im trying to debug this program and somethign seems to be wrong with the Scanner utility i am using from java. Help!! whats wrong with this code??

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package lab2;
import java.util.Scanner ;
/** @author Jayson
*/
public class Main {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int firstNumber, secondNumber, thirdNumber ;
Scanner keyboard = new Scanner(System.ini);
System.out.println(“Enter first number: “);
firstNumber=keyboard.nextInt();
System.out.println(“Enter second number: “);
secondNumber=keyboard.nextInt();
System.out.println (“Enter third number: “);
thirdNumber=keyboard.nextInt();
System.out.println(“The sum of the numbers is ” + ((firstNumber + secondNumber + thirdNumber)/3));

System.out.println(“The average of the numbers is ” + ((firstNumber + secondNumber + thirdNumber)/3));

// BELOW IS WHAT I GET WHEN I RUN/DEBUG THE PROGRAM
/*run:
Exception in thread “main” java.lang.RuntimeException: Uncompilable source code – cannot find symbol
symbol : constructor Scanner(java.lang.System.ini)
location: class java.util.Scanner
at lab2.Main.main(Main.java:17)
Java Result: 1
BUILD SUCCESSFUL (total time: 3 seconds)*/

Best answer:

my friend knows it.ask her.

Tags: , , , ,

Under Forum

2 Comments for i need some NetBeans help again!!!?

  • 1. two pi  |  June 18th, 2007 at 1:04 pm

    You’re not creating the scanner properly.

    It’s like this:
    Scanner keyboard = new Scanner(System.in);

    You said System.ini

    That should do the trick…

  • 2. Robot29  |  June 18th, 2007 at 2:00 pm

    change System.ini to System.in when your creating your scanner

Leave a Comment for i need some NetBeans help again!!!?

Required

Required, hidden

Trackback this post  |  Subscribe to the comments via RSS Feed


Forum