Skip to content

Instantly share code, notes, and snippets.

@thinkphp
Created April 9, 2025 17:20
Show Gist options
  • Save thinkphp/378633aaba1619d875a37df8bbe72061 to your computer and use it in GitHub Desktop.
Save thinkphp/378633aaba1619d875a37df8bbe72061 to your computer and use it in GitHub Desktop.
Test Forme GEometrice
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