الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

اتمنى مساعدتي في شرح الكود وحل لي

بدأه aoao1011 في 12 فبراير 2012 · 3 رد · 616 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

الدرس عن الكائنات

كيف اعرف البانيات ؟؟؟

وكيف كمان اعرف الكائنات ؟؟ وكيف حل البرنامج من وين ابدا في الحل

public class constructorOverloading{
    public static void main(String[] args) {
    RectangLe rectangle1=new RectangLe(2,4);
    int areaInfirstConstructor=rectangle1.first();
    System.out.println("ggg"+areaInfirstConstructor);
    RectangLe rectangle2=new RectangLe(5);
    int areaInsecondConstructor=rectangle2.second();
    System.out.println("ggg"+areaInsecondConstructor);
    RectangLe rectangle3=new RectangLe(2.Of);
    float areaInthirdConstructor=rectangle3.third();
    System.out.println("ggg"+areaInthirdConstructor);
    Rectangle rectangle4=new Rectange(3.Of,2.Of);
    float areaInfourthConstructor=rectangle3.fourth();
     System.out.println("ggg"+areaInfourthConstructor);
    }
    }
    class Rectangle{
    public int l,b;
    public float p,q;
    public Rectangle(int x, int y){
        l = x;
        b = y;
    }
    public int first(){
        return(l*b);
    }
     public Rectangle(int x){
      l = x;
        b = x;
     }
      public int second(){
         return(l*b);
      }
     public Rectangle(float x){
        p = x;
        q = x;
     }
      public float third(){
         return(p*q);
      }
        public Rectangle(float x,float y){
        p = x;
        q = y;
        }
   public float fourth (){
        return(p*q);
}
    }
}

تم تعديل هذه المشاركة بواسطة __Unknown في 12 فبراير 2012 في 14:40

#2

ما سؤالك؟

#3

الدرس عن الكائنات في الجافا

كيف اعرف البانيات ؟؟؟

وكيف كمان اعرف الكائنات ؟؟ وكيف حل البرنامج من وين ابدا في الحل

#4

تحتاج للتعلم اولا

اذهب لقسم المواضيع المميزه بالاعلى

مواضيع مشابهة