Guest User

Untitled

a guest
Oct 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public class Dreptunghi {
  2. int lung,lat;
  3. public Dreptunghi(){}
  4. public Dreptunghi(double lung,double lat) {
  5. this.lung=lung;
  6. this.lat=lat;
  7. }
  8. double arie() {
  9. return lung*lat;
  10. }
  11. double perimetru(){
  12. return (2*lung)+(2*lat);
  13. }
  14. void afisare(){
  15. System.out.println("lungime"+lung,"latime"+lat);
  16.  
  17. }
  18.  
  19. public static void main(String [] args) {
  20. Dreptunghi d=new Dreptunghi(3,5);
  21. System.out.println(d.arie());
  22.  
  23. }
  24. }
Add Comment
Please, Sign In to add comment