hamaXD

LAB1 Square

Jan 31st, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. public class Square{
  2.     private  int area;
  3.     private int width;
  4.  
  5.     public Square(){
  6.         width =0;
  7.         area=0;
  8.     }
  9.  
  10.     public void setWidth(int temp){
  11.         width = temp;
  12.     }
  13.    
  14.     public void calcArea(){
  15.         area = width*width;
  16.     }
  17.     public  void showArea(){
  18.             return area;
  19.     }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment