438
Підписники
-224 години
-27 днів
-1330 днів
Архів дописів
باختصار، استخدام الكلمة الرئيسية
static في دالة main في Java يجعلها نقطة البداية لتنفيذ البرنامج بدون الحاجة إلى إنشاء كائن من الفئة المحتوية عليها، مما يجعلها معيارية ومناسبة للاستخدام في البرامج الجافا.One of the reasons to use static variables is memory efficiency?
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");
}
}
تتبع استاذ خالد:
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");
}
}
}
ما ناتج البرنامج على الشاشة الرن؟؟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);
}
}
}
شن الرن؟
تتبع اسئلة امتحاناتRepost from تجمع طلبة تقنية المعلومات جامعة بنغازي
https://t.me/Information_technologygro
قروب الأعلانات
Repost from O.O.P
مشاهدة "#044 [JAVA] - Types of Relationships (Association, Aggregation "has-a", Composition "part-of")" على YouTube
https://youtu.be/c-KSvbSoVW0
Repost from O.O.P
مشاهدة "#045 [JAVA] - Types of Relationships (Association, Aggregation, Composition) With Example" على YouTube
https://youtu.be/JXzBz03szvI
