// ParameterPassing2.java
// Method basics with parameter passing
// Calculates area of a rectangle
// Shorter but more confusing version of ParameterPassing1.java
import java.awt.*;
import javax.swing.*;;

public class ParameterPassing2 extends JApplet {
	// Applet's paint method( ) which automatically comes with an applet
	public void paint( Graphics g ) {
		int length = 5;
		int width = 4;
		g.drawString( "The area is equal to " + calcArea( length, width ) + ".", 25, 50 );
	}

	int calcArea( int l, int w ) {
		return l * w;
	}
}