Hello,

I used to do do some VB a while back and now i'm trying to start teaching myself Java. But i'm having a little problem.

I've searched the forums and found a couple of very simple examples. Some whice i can relate to my small knowledge of VB.

A temperature program someone had made:

VB Code:
  1. public class MyApp
  2. {
  3.   public static void main ( String[] args )
  4.   {
  5.     Scanner scan = new Scanner( System.in ) ;
  6.     int temp ;
  7.     System.out.print( "Enter the temperature: " ) ;
  8.     temp = scan.nextInt() ;
  9.     System.out.print( "Activity: ") ;
  10.     if ( temp >= 80 && temp <= 95 )
  11.     {
  12.       System.out.println( "Swimming" ) ;
  13.     }
  14.     else if ( temp > 95 || temp < 20 )
  15.     {
  16.       System.out.println( "Visit our Shop!" ) ;
  17.     }
  18.     else if ( temp >= 60 || temp < 80 )
  19.     {
  20.       System.out.println( "Tennis" ) ;
  21.     }
  22.     else if ( temp >= 40 || temp < 60 )
  23.     {
  24.       System.out.println( "Golf" ) ;
  25.     }
  26.     else if ( temp < 40 )
  27.     {
  28.       System.out.println( "Skiing" ) ;
  29.     }
  30.   }
  31. }

I'm pretty sure i've installed the JAVA 1.5 correctly, the file name was "jdk-1_5_0_08-windows-i586-p" and i just used the default install directory and didnt change any options.

I'm not sure what IDE i should be using but i found a free one called iGRASP. Please give your views on this, and weather i should chance to a different one.

Anyway - to the problem.

i get an error consisting of:
---------------------------------------------------------
Temperature.java:1: class MyApp is public, should be declared in a file named MyApp.java
public class MyApp
^
Temperature.java:5: cannot find symbol
symbol : class Scanner
location: class MyApp
Scanner scan = new Scanner( System.in ) ;
^
Temperature.java:5: cannot find symbol
symbol : class Scanner
location: class MyApp
Scanner scan = new Scanner( System.in ) ;
^
3 errors

----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.

---------------------------------------------------------

From what i can tell from reading other posts about the same thing, i havnt got it installed correctly? is this the case?

Thanks for any help or advice you can give me! Its all greatly appreciated!

Regards

Mathew