ch
Feedback
تجمع شيتات واسئلة oop

تجمع شيتات واسئلة oop

前往频道在 Telegram
438
订阅者
-224 小时
-27 天
-1330 天
帖子存档
composited object can have their own life cycle
Anonymous voting

a composite object cannot exist on its own
Anonymous voting

is another one of the core concepts of object oriented programing it focuses on establishing a strong has a relationship between the three class
Anonymous voting

has a relationship denotes a whole part relatiosnship where a part cannot exist whithout the whole
Anonymous voting

Naming a unchecked exception by checked because it checks at
Anonymous voting

a most common example af has relationship in java
Anonymous voting

مصطلح constractor chaining
مصطلح constractor chaining

كلام مش منطقي لاكن يمشي بلحفظ
كلام مش منطقي لاكن يمشي بلحفظ

why multiple inheriance is not supported in java???

superclass is typically a more specialized version of its subclass
Anonymous voting

the transitive natire of inheriance is reflected by this from of inheriance
Anonymous voting

type of inheriance 1.single inheriance 2.multilevel inheriance 3.Hierarchical inheriance 4.hybrid inheriance الخامسة متدعمش فيها الجافا 5. multiple inheriance

:
interface InterfaceA {
    default void display() {
        System.out.print("#");
    }
}

interface InterfaceB {
    void display();  // دالة مجردة
}

class ImplementationClass implements InterfaceA, InterfaceB {
    @Override
    public void display() {
        System.out.println("Display method in ImplementationClass");
    }
}

public class Main {
    public static void main(String[] args) {
        ImplementationClass obj = new ImplementationClass();
        obj.display();   ImplementationClass
    }
}

:
class Shape {
    protected int x;

    public Shape(int x) {
        this.x = x;
        System.out.println("Shape constructor called with x = " + this.x);
    }
}

class Circle extends Shape {
    private int radius;

    public Circle(int x, int radius) {
        
        this.radius = radius;
        System.out.println("Circle constructor called with radius = " + this.radius);
    }
}


public class Main {
    public static void main(String[] args) {
        Circle circle = new Circle(10, 5);  
    }
}

class Shape {
    protected int x; // متغير x

    // منشئ يأخذ قيمة String
    public Shape(String x) {
        this.x = Integer.parseInt(x);
        System.out.println("Shape constructor called with x = " + this.x);
    }

    // منشئ فارغ لتعيين قيمة افتراضية لـ x
    public Shape() {
        this.x = 0; // تعيين قيمة افتراضية لـ x
        System.out.println("Default Shape constructor called with x = " + this.x);
    }
}

class Circle extends Shape {
    private int radius;

    // منشئ يأخذ radius فقط ويقوم بتهيئة x مباشرة باستخدام الكونستركتر الافتراضي
    public Circle(int radius) {
        this.radius = radius;
        this.x = 0; // تعيين قيمة مباشرة لـ x إذا كنت لا تريد استخدام super
        System.out.println("Circle constructor called with radius = " + this.radius);
    }

    public void show() {
        System.out.println("Radius: " + radius);
        System.out.println("Shape's x: " + this.x); // الوصول إلى متغير x من الفئة الأساسية
    }
}

public class Program4 {
    public static void main(String[] args) {
        Circle c1 = new Circle(10);
        c1.show();

}}

جمعة طيبة للجميع الرجاء ابلاغ جميع الطلبة بان Array list and array of object غير داخلة للامتحان

@AcademAidBot.بوت يساعد في حل الاكواد يعطيك الoutput

photo content

Repost from N/a
الجماعة اللي ياخدو من منهج ال oop ال pdf بتاع سارية راهو في نسخة قديمة(اسمها OOP منهج كامل) ناقصة صفحات عن ال has a ومنعرفش لو في نقص اخرى ف هدي النسخة الجديدة