Results 1 to 3 of 3
- 01-20-2012, 04:27 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 1
- Rep Power
- 0
Java in eclipse JRE 6.0 not working...
This won't work in eclipse JRE 6.0
import java.util.scanner;
import java.io.*;
public class homework1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.println("Hi, This is a program to calculate Area of a Square");
System.out.print("What is the length of the square");
double length = input.nextDouble();
System.out.print("What is the width of the square");
double width= input.nextDouble();
double area= width * length;
System.out.print("The area of the square is");
System.out.println (area);
// TODO Auto-generated method stub
}
}
It gives back
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Scanner cannot be resolved to a type
Scanner cannot be resolved to a type
at homework1.main(homework1.java:11)
Any idea?
- 01-20-2012, 06:38 AM #2
Re: Java in eclipse JRE 6.0 not working...
Please don't post beginner questions in 'Advanced Java'. I've moved the thread here.
That's because you didn't import ScannerUnresolved compilation problems:
Scanner cannot be resolved to a type
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 01-20-2012, 06:49 AM #3
Similar Threads
-
eclipse working with few files
By second_ffgf in forum EclipseReplies: 0Last Post: 11-28-2011, 05:07 PM -
Ant and Eclipse not working??
By dochaolic in forum New To JavaReplies: 0Last Post: 11-19-2011, 01:31 AM -
Getting httpclient working with eclipse.
By int80 in forum EclipseReplies: 4Last Post: 03-31-2009, 01:17 PM -
JSP 2.0 not working on eclipse
By iuna in forum EclipseReplies: 1Last Post: 03-25-2009, 09:39 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks