جافا Java
Открыть в Telegram
ليس عيبًا ألا تعرف شيئًا، ولكن العيب انك لا تريد أن تتعلم
Больше6 338
Подписчики
-324 часа
-137 дней
-5130 день
Архив постов
6 338
❓ حقول مقابل دالة مُعاد تعريفها
Fields vs overridden method
class A { int v = 1; int get(){ return v; } }
class B extends A { int v = 2; int get(){ return v; } }
A a = new B();
System.out.println(a.v + "," + a.get());6 338
❓ اختيار overload مع null
Overload resolution with null
void f(Object o){ System.out.print("O"); }
void f(String s){ System.out.print("S"); }
f(null);6 338
❓ تمرير مصفوفة لميثود
Passing array to method
static void inc(int[] a){
for (int i = 0; i < a.length; i++) a[i]++;
}
int[] a = {0,1,2};
inc(a);
System.out.println(a[2]);6 338
❓ switch مع break
switch with break
int n = 1;
switch (n) {
case 1: System.out.print("X"); break;
default: System.out.print("Y");
}6 338
❓ اقتران else بالأقرب
else pairs with nearest if
int x = 0, y = 10;
if (y > 0)
if (x == 1) System.out.print("A");
else System.out.print("B");6 338
❓ do-while تُنفَّذ مرة على الأقل
do-while runs at least once
int i = 5;
do { i++; } while (i < 5);
System.out.println(i);6 338
❓ ما ناتج الجمع مع break؟
What is the output with break?
int sum = 0;
for (int i = 1; i <= 5; i++) {
if (i == 4) break;
sum += i;
}
System.out.println(sum);6 338
Enjoy our content? Advertise on this channel and reach a highly engaged audience! 👉🏻
It's easy with Telega.io. As the leading platform for native ads and integrations on Telegram, it provides user-friendly and efficient tools for quick and automated ad launches.
⚡️ Place your ad here in three simple steps:
1 Sign up
2 Top up the balance in a convenient way
3 Create your advertising post
If your ad aligns with our content, we’ll gladly publish it.
Start your promotion journey now!
6 338
❓ استخدام this للإشارة لحقل مُغَطّى
Using this to refer to a shadowed field
class T {
int n = 10;
void set(int n){ n = n; }
int get(){ return n; }
}
T t = new T();
t.set(5);
System.out.println(t.get());
Уже доступно! Исследование Telegram 2025 — ключевые инсайты года 
