Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package shape;
- /**
- *
- * @author user
- */
- public class Square {
- private double length;
- public double area(double length) {
- return (length * length);
- }
- public double perimeter (double length) {
- return (4 * length);
- }
- public void area() {
- System.out.println("Area of the Square: " + (length * length));
- }
- public void perimeter () {
- System.out.println("Perimeter of the Square: " + (4 * length));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement