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 Triangle {
- private double base;
- private double height;
- public double area(double base, double height) {
- return (1/2 * base * height);
- }
- public void area() {
- System.out.println("Area of the Triangle: " + (1/2 * base * height));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement