2⃣ Composition
The relationship between the whole and the part, but the whole and the part cannot be separated .
The combination relationship represents the relationship between the whole and part of the class, and the overall and part have a consistent lifetime. Once the overall object does not exist, some of the objects will not exist, and they will all die in the same life.For example, a person is composed of a head and a body.
ملخص الكلام ان العلاقة تكون مابين الاوبجيكت والثاني قوية بحيث اذا انتهى الاول ينتهى الثاني معه لذلك يسموها علاقة جزء من كل
#classes_relationship
#Java_Level_2
————————————————
📍Channel: @java_tutorial0101
The relationship between the whole and the part, but the whole and the part cannot be separated .
The combination relationship represents the relationship between the whole and part of the class, and the overall and part have a consistent lifetime. Once the overall object does not exist, some of the objects will not exist, and they will all die in the same life.For example, a person is composed of a head and a body.
ملخص الكلام ان العلاقة تكون مابين الاوبجيكت والثاني قوية بحيث اذا انتهى الاول ينتهى الثاني معه لذلك يسموها علاقة جزء من كل
#classes_relationship
#Java_Level_2
————————————————
📍Channel: @java_tutorial0101
👍2❤🔥1
3⃣ Aggregation
The relationship between the whole and part, and the whole and part can be separated.
Aggregate relations also represent the relationship between the whole and part of the class, member objects are part of the overall object, but the member object can exist independently from the overall object.
For example, bus drivers and work clothes and hats are part of the overall relationship, but they can be separated. Work clothes and hats can be worn on other drivers. Bus drivers can also wear other work clothes and hats.
بمعنى أن كل اوبجيكت مستقل عن الاخر فقط يتم الاستفاده من اوبجيكت معين في لفتره محدوده وذا انتهى الاوبجيكت الاول يبقى الثاني كما هو ولا يتأثر اي ان هذه العلاقة عكس ال composition تماما
#classes_relationship
#Java_Level_2
————————————————
📍Channel: @java_tutorial0101
The relationship between the whole and part, and the whole and part can be separated.
Aggregate relations also represent the relationship between the whole and part of the class, member objects are part of the overall object, but the member object can exist independently from the overall object.
For example, bus drivers and work clothes and hats are part of the overall relationship, but they can be separated. Work clothes and hats can be worn on other drivers. Bus drivers can also wear other work clothes and hats.
بمعنى أن كل اوبجيكت مستقل عن الاخر فقط يتم الاستفاده من اوبجيكت معين في لفتره محدوده وذا انتهى الاوبجيكت الاول يبقى الثاني كما هو ولا يتأثر اي ان هذه العلاقة عكس ال composition تماما
#classes_relationship
#Java_Level_2
————————————————
📍Channel: @java_tutorial0101
❤🔥1
4⃣ Association
Indicates that a property of a class holds a reference to an instance (or instances) of another class .
Association is the most commonly used relationship between a class and a class, which means that there is a connection between one type of object and another type of object. Combinations and aggregations also belong to associative relations , but relations between classes of affiliations are weaker than the other two.
There are four kinds of associations : two-way associations , one-way associations , self-association , and multiple-number associations .
For example: cars and drivers, one car corresponds to a particular driver, and one driver can drive multiple cars.
#classes_relationship
#Java_Level_2
————————————————
📍Channel: @java_tutorial0101
Indicates that a property of a class holds a reference to an instance (or instances) of another class .
Association is the most commonly used relationship between a class and a class, which means that there is a connection between one type of object and another type of object. Combinations and aggregations also belong to associative relations , but relations between classes of affiliations are weaker than the other two.
There are four kinds of associations : two-way associations , one-way associations , self-association , and multiple-number associations .
For example: cars and drivers, one car corresponds to a particular driver, and one driver can drive multiple cars.
#classes_relationship
#Java_Level_2
————————————————
📍Channel: @java_tutorial0101
❤🔥1
❤🔥1👍1
public class Pattern {
public static void main(String[] args) {
int row=5;
for (int i = 0; i < row; i++) {
for (int j = 0; j < row-i; j++) {
System.out.print(" ");
}
for (int j = 0; j <=i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
#Java_Level_2//————————————————-
// Telegram channel:@java_tutorial0101
❤2👍2
📌 Exceptions handling
——————————————————-
الترجمة الحرفيه لهذا المصطلح هو : معالجة الاستثناءات
المقصود بهذا الموضوع هو ادراة الاحداث الغير مرغوبه او الغير متوقعه التي تحدث اثناء تنفيذ البرنامج او اثناء العمل عليه لتجنب الخروج المفاجئ من البرنامج وما الى ذلك من الاخطاء التي قد تحدث بسبب ادخال خاطئ او عدم وجود بيانات معينة... اي بمعنى انها اخطاء لا تحدث اثناء كتابة الكود.
ملاحظة مهمة :
الاخطاء من هذا النوع سهل حلها من قبل المبرمج نفسه بحيث يقوم بكتابة اكواد معينه تعمل على معالجة هذي الاخطاء وذلك عن طريق تفادي وقوعها .
بتعرفوا كل شي بالتفصيل في الفيديوهات المرفقة اسفل الشرح
————————————————————
#Java_Level_2
Tel: @Java_tutorial0101
——————————————————-
الترجمة الحرفيه لهذا المصطلح هو : معالجة الاستثناءات
المقصود بهذا الموضوع هو ادراة الاحداث الغير مرغوبه او الغير متوقعه التي تحدث اثناء تنفيذ البرنامج او اثناء العمل عليه لتجنب الخروج المفاجئ من البرنامج وما الى ذلك من الاخطاء التي قد تحدث بسبب ادخال خاطئ او عدم وجود بيانات معينة... اي بمعنى انها اخطاء لا تحدث اثناء كتابة الكود.
ملاحظة مهمة :
الاخطاء من هذا النوع سهل حلها من قبل المبرمج نفسه بحيث يقوم بكتابة اكواد معينه تعمل على معالجة هذي الاخطاء وذلك عن طريق تفادي وقوعها .
بتعرفوا كل شي بالتفصيل في الفيديوهات المرفقة اسفل الشرح
————————————————————
#Java_Level_2
Tel: @Java_tutorial0101
❤2
📌الفرق بين Error و Exception
—————————————--
يمكن تلخيص الفروقات كالتالي:
التعريف:
Error:
هي مشكلات جسيمة تحدث على مستوى النظام أو البيئة، وتكون عادةً خارج سيطرة البرنامج.
—————
Exception:
هي مشكلات تحدث أثناء تشغيل البرنامج بسبب أخطاء برمجية أو مدخلات غير صحيحة، ويمكن معالجتها.
——————————————-
أمثلة:
Error:
مثل OutOfMemoryError (نفاد الذاكرة)، وStackOverflowError (تجاوز سعة المكدس).
—————
Exception:
مثل NullPointerException (محاولة الوصول إلى كائن فارغ)
وIOException (خطأ في الإدخال/الإخراج).
———————————————————
إمكانية المعالجة:
Error:
لا يستطيع المبرمج معالجة الأخطاء باستخدام الكود البرمجي، لأنها عادة تتطلب إصلاحات على مستوى النظام.
—————
Exception:
يمكن للمبرمج معالجتها باستخدام try-catch وغيرها... لمنع توقف البرنامج.
——————————————————
الأصل:
Error:
تنحدر من المكتبة
java.lang.Error.
—————
Exception:
تنحدر من المكتبة
java.lang.Exception.
—————————————-
التأثير:
Error:
عادة ما تتسبب في توقف البرنامج بالكامل.
—————
Exception:
يمكن التعامل معها، والبرنامج يستمر في التنفيذ.
————————————————————
#Java_Level_2
Tel: @Java_tutorial0101
—————————————--
يمكن تلخيص الفروقات كالتالي:
التعريف:
Error:
هي مشكلات جسيمة تحدث على مستوى النظام أو البيئة، وتكون عادةً خارج سيطرة البرنامج.
—————
Exception:
هي مشكلات تحدث أثناء تشغيل البرنامج بسبب أخطاء برمجية أو مدخلات غير صحيحة، ويمكن معالجتها.
——————————————-
أمثلة:
Error:
مثل OutOfMemoryError (نفاد الذاكرة)، وStackOverflowError (تجاوز سعة المكدس).
—————
Exception:
مثل NullPointerException (محاولة الوصول إلى كائن فارغ)
وIOException (خطأ في الإدخال/الإخراج).
———————————————————
إمكانية المعالجة:
Error:
لا يستطيع المبرمج معالجة الأخطاء باستخدام الكود البرمجي، لأنها عادة تتطلب إصلاحات على مستوى النظام.
—————
Exception:
يمكن للمبرمج معالجتها باستخدام try-catch وغيرها... لمنع توقف البرنامج.
——————————————————
الأصل:
Error:
تنحدر من المكتبة
java.lang.Error.
—————
Exception:
تنحدر من المكتبة
java.lang.Exception.
—————————————-
التأثير:
Error:
عادة ما تتسبب في توقف البرنامج بالكامل.
—————
Exception:
يمكن التعامل معها، والبرنامج يستمر في التنفيذ.
————————————————————
#Java_Level_2
Tel: @Java_tutorial0101
❤2👍2