-
-
Save uncoded-ro/9a2d09109a209c0e1501efe4542dec4e to your computer and use it in GitHub Desktop.
This file contains 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
package ro.virtualcampus.app; | |
public class ObiecteGrafice { | |
public static void main(String args[]) { | |
ro.virtualcampus.obiectgrafic.Cerc cerc = | |
new ro.virtualcampus.obiectgrafic.Cerc(2.3, 3.4, 1.5); | |
ro.virtualcampus.obiectgrafic.Dreptunghi dreptunghi = | |
new ro.virtualcampus.obiectgrafic.Dreptunghi(5.2, 1.8, 3.4, 4.8); | |
System.out.println(cerc); | |
System.out.println(dreptunghi); | |
System.out.printf("Aria cerc: %.2f %n", cerc.aria()); | |
System.out.printf("Perimetru cerc: %.2f %n", cerc.perimetrul()); | |
System.out.printf("Aria dreptunghi: %.2f %n", dreptunghi.aria()); | |
System.out.printf("Perimetru dreptunghi: %.2f %n", dreptunghi.perimetrul()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment