Using square
import java.io.* ;
public class Welcome2 {
public static void main(String args[]) throws IOException {
for (int i = 0; i < 10;i++)
System.out.println(I + “ * “ + I + “ == “ square(I));
}
public int square(int y) {
return y * y ;
}
}
Previous slide
Next slide
Back to first slide
View graphic version