قناة منهج كلية تقنية المعلومات |2005|
前往频道在 Telegram
رابط قناة المناقشة الخاص بنا، تفضل و اسأل اي سؤال و الكل حيجاوبك و المحترم يحترم. https://t.me/+n9odr2ZtI1Y1OGFk
显示更多337
订阅者
+524 小时
+67 天
+930 天
帖子存档
If no visibility modifier is used, then by default the classes,methods, and data fields are accessible by any class in the same package. This is also known as...
Constructor can be private provided an object of one class created in another class.
Method names begin with a lowercase first letter and subsequent words in the name end with a capital letter.
When a method terminates, the values of its local variables will still be available.
Each object (instance) of the class has a separate instance of the variable in memory.
The new operator is not required to explicitly create the object that is referenced
The return type .... indicates that a method will perform a task but will not return.
.... and .......are the primary mechanisms for passing information into and out of an object.
A primitive data type can be cast to an object that is referenced
Method is overriden not the datamembers, so runtime polymorphism can be achieved by data members
نسيت نحط int ، الإجابة يعتبر غلط، معليش 👀
لكن المهم فهمتوا قصدي
في interface، لما بنعرفوا متغير، ضروري نعطوه قيمة و إلا حيعتبر compile time error، و السبب علشان أنه static.
طريقة تعريف المتغير يعتبر صح في الحالات الموجودة في الصورة، سواء كتبت static او final او public أو الكل او البعض ، مش حيعتبر خطأ و يمشي صح. لأنه الكومبايلر حيشوف و يديره من عنده لو ماحطيتش.
و نفس الفكرة عند الدوال. مش ضروري تكتب abstract لأنه الكومبايلر حيديره لك تلقائيا. و هنا نحكي عن interface مش كلاس abstract.
public interface AnInterface{
public static O=10; Public void Oop(); } Will it compile?
Since ..., we can have private methods in an interface.
Encapsulation is also known as Data abstraction
