Created
April 9, 2025 17:20
-
-
Save thinkphp/378633aaba1619d875a37df8bbe72061 to your computer and use it in GitHub Desktop.
Test Forme GEometrice
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 TestFormeGeometrice { | |
public static void main(String[] args) { | |
FormaGeometrica cerc = new Cerc("rosu",5.5); | |
FormaGeometrica dreptunghi = new Dreptunghi("albastru", 3.0, 5.0); | |
System.out.println("Detalli despre Cerc:"); | |
cerc.afiseazaDetalii(); | |
System.out.println("Detalli despre Dreptunghi:"); | |
dreptunghi.afiseazaDetalii(); | |
FormaGeometrica[] forme = new FormaGeometrica[2]; | |
forme[0] = cerc; | |
forme[1] = dreptunghi; | |
System.out.println("\nParcurgerea tuturor formelor: "); | |
for(FormaGeometrica forma: forme) { | |
forma.afiseazaDetalii(); | |
System.out.println(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment