java
public class A{
private int x=0;
public A(){ this(x); x++; System.out.print(x);}
public A(int x){ this.x+=x;}
public A(int x,int y){ this.x+=y+x;}
}
public class B extends A{
private int x=17;
public B(){ this(2,2);
System.out.print(x); }
public B(int x,int y){ super(x,y); }
}
public class programs5{
public static void main(){
A obj=new B();
}
}
كم طلع معاكم الرن
❤1
Forwarded from آلَآيــتــيـــوُنــــ💻 (Admin)
Object-Oriented Approach_IT.2022 (1) (1).pdf
3 MB
الجماعة اللي ياخدو من منهج ال oop ال pdf بتاع سارية
راهو في نسخة قديمة(اسمها OOP منهج كامل) ناقصة صفحات عن ال has a ومنعرفش لو في نقص اخرى
ف هدي النسخة الجديدة
راهو في نسخة قديمة(اسمها OOP منهج كامل) ناقصة صفحات عن ال has a ومنعرفش لو في نقص اخرى
ف هدي النسخة الجديدة
Forwarded from خالد الرفادي
جمعة طيبة للجميع
الرجاء ابلاغ جميع الطلبة بان
Array list and array of object
غير داخلة للامتحان
الرجاء ابلاغ جميع الطلبة بان
Array list and array of object
غير داخلة للامتحان
❤5
class Shape {
protected int x;
String
public Shape(String x) {
this.x = Integer.parseInt(x);
System.out.println("Shape constructor called with x = " + this.x);
}
public Shape() {
this.x = 0;
System.out.println("Default Shape constructor called with x = " + this.x);
}
}
class Circle extends Shape {
private int radius;
public Circle(int radius) {
this.radius = radius;
this.x = 0;
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);
}
}
public class Program4 {
public static void main(String[] args) {
Circle c1 = new Circle(10);
c1.show();
}}:
شن الرن هنا
class Shape {
protected int x;
public Shape(int x, int y) {
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);
}
}شن الرن هنا
:
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();
}
}type of inheriance
1.single inheriance
2.multilevel inheriance
3.Hierarchical inheriance
4.hybrid inheriance
الخامسة متدعمش فيها الجافا
5. multiple inheriance
1.single inheriance
2.multilevel inheriance
3.Hierarchical inheriance
4.hybrid inheriance
الخامسة متدعمش فيها الجافا
5. multiple inheriance
the transitive natire of inheriance is reflected by this from of inheriance
Anonymous Quiz
23%
single
27%
multiple
34%
multilevel
16%
Hierarchical
❤1