Created
April 9, 2025 17:13
-
-
Save thinkphp/013e0c184c3f2a609c5303e130e5d97d to your computer and use it in GitHub Desktop.
cerc 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 Cerc extends FormaGeometrica { | |
private double raza; | |
public Cerc(String culoare, double raza) { | |
//super apeleaza constructorul clasei de baza | |
//FormaGeometrica(culoare) | |
super( culoare ); | |
this.raza = raza; | |
} | |
@Override | |
public double calculeazaArea(){ | |
return Math.PI * raza * raza; | |
} | |
@Override | |
public double calculeazaPerimetru() { | |
return 2 * Math.PI * raza ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment