تجمع شيتات واسئلة oop
813 subscribers
345 photos
12 videos
166 files
37 links
شوفو التثبيتات واتركو لنا دعوة جزاكم الله خيرا. 🤍
Download Telegram
محاضرة أستاذ خالد هذا الاسبوع

مفهوم
super
final
override
upcasting
downcasting
class Main {
public static void main(String[] args) {
Child c = new Child(5);
}

class Parent {
Parent(int x) {
System.out.print("x");
}

Parent(String A) {
System.out.print(A);
}
}

class Child extends Parent {
Child(String name) {
super("10"); // استدعاء constructor of Parent with String parameter
System.out.print(name);
}
}
}


شن الرن؟

تتبع اسئلة امتحانات
:
java
class Main {
public static void main(String[] args) {
Child c = new Child("5");
}

class Parent {
Parent(int x) {
System.out.print(p int);
}

Parent(String A) {
System.out.print(A);
}
}

class Child extends Parent {
Child(int num) {
super("10");
System.out.print("int");
}
}

ما ناتج البرنامج على الشاشة الرن؟؟
👍1
تتبع الوراثة⬆️
@AMVIIPbot

بوت برمجة يساعدك
package run;


class A
{
A()
{
this("khalid");
System.out.println("A");
}
public A(String c)
{

System.out.println(c);
}
}
class B extends A
{
B()
{
this("mohammed");
System.out.println("B");

}

public B(String c)
{

System.out.println(c);
}
}
class C extends B
{
C()
{
System.out.println("Erfadi");
}
public C(String c)
{
this();
System.out.println(c);
}
}

public class Run {


public static void main(String[] args)
{
C c=new C("khalid");
}

}

تتبع استاذ خالد