cannot find symbol: method Scanner(java.io.InputStream)

G'day everyone

I am just beginning a university course in programming and I previously have no experience with it. It's only an introduction course so not difficult to pick up, however I am having a problem compiling a simple program designed to calculate the area and perimeter of a rectangle after receiving input from the user (height and length values).

The error my IDE (TextPad) is providing is:

C:\Users\Shannon\Documents\ADFA\Programming\Assign ment Two\rectangle.java:22: cannot find symbol

symbol : method Scanner(java.io.InputStream)

location: class rectangle

Scanner input = Scanner(System.in);

^

1 error

Tool completed with exit code 1

This is the code I have written:

//************************************************** ***************************

// rectangle.java Author Shannon Emanuel

//

// Calculates the area and perimeter of a rectangle

// where area=width*height and perimeter=2*(width+height)

//

//************************************************** ***************************

import java.util.Scanner;

public class rectangle

{

public static void main (String[] args)

{

int width;

int height;

int area;

int perimeter;

//Obtaining the parameters for calculations

Scanner input = Scanner(System.in);

System.out.print ("Please enter the horizontal width:"); //obtains width

width = input.nextInt();

System.out.print ("Please enter the vertical height:"); //obtains height

height = input.nextInt();

//Performing the calculations

area = width*height;

perimeter = 2*(width+height);

//Output of the answers

System.out.println ("The area of the rectangle is " + area);

System.out.print ("The perimeter of the rectangle is " +perimeter);

}

}

If anyone could help me figure out what I am doing wrong I would really appreciate the help.

Thanks!

Shannon