public class Square{
private double height;
private double weight;
private double surfaceArea;
public Square(double height,double weigth){
this.height=height;
this.weight=weight;
}
public void computeSurfaceArea(){
surfaceArea=getHeight() * getWeight();
}
public double getHeight(){
return height;
}
public double getWeight(){
return weight;
}
public double getSurfaceArea(){
return surfaceArea;
}
}
public class DemoSquare{
public static void main(String args[]){
Square square=new Square(3,4);
square.computeSurfaceArea();
System.out.println(square.getSurfaceArea());
}
}