A Whole Program
import java.io.*;
public class Rectangle{
public int width;
public int length;
public Rectangle(int side1, int side2) {
width = side1;
length = side2;
}
public int area() {
return(length * width);
}
}
Indicate that we want to be
be able to use any class
in package java.io
Note: java.lang is always
automatically imported.
That�s where
system.out.println comes
from, for example
Previous slide
Next slide
Back to first slide
View graphic version