SHARE
TWEET

Subal (Square.java)

a guest Mar 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package shape;
  6.  
  7. /**
  8.  *
  9.  * @author user
  10.  */
  11. public class Square {
  12.     private double length;
  13.     public double area(double length) {
  14.         return (length * length);
  15.     }
  16.    
  17.     public double perimeter (double length) {
  18.         return (4 * length);
  19.     }
  20.     public void area() {
  21.         System.out.println("Area of the Square: " + (length * length));
  22.     }
  23.    
  24.     public void perimeter () {
  25.         System.out.println("Perimeter of the Square: " + (4 * length));
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top