Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Dreptunghi {
- int lung,lat;
- public Dreptunghi(){}
- public Dreptunghi(double lung,double lat) {
- this.lung=lung;
- this.lat=lat;
- }
- double arie() {
- return lung*lat;
- }
- double perimetru(){
- return (2*lung)+(2*lat);
- }
- void afisare(){
- System.out.println("lungime"+lung,"latime"+lat);
- }
- public static void main(String [] args) {
- Dreptunghi d=new Dreptunghi(3,5);
- System.out.println(d.arie());
- }
- }
Add Comment
Please, Sign In to add comment