Created
April 9, 2025 17:13
-
-
Save thinkphp/7be7fab6e6e31b4fcddddb1d8f625f2a to your computer and use it in GitHub Desktop.
Dreptunghi java class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Dreptunghi extends FormaGeometrica { | |
private double lungime; | |
private double latime; | |
public Dreptunghi(String culoare, double lungime, double latime) { | |
super(culoare); | |
this.lungime = lungime; | |
this.latime = latime; | |
} | |
@Override | |
public double calculeazaArea() { | |
return lungime * latime; | |
} | |
@Override | |
public double calculeazaPerimetru() { | |
return 2 * (lungime + latime); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment