جافا Java
前往频道在 Telegram
6 098
订阅者
+224 小时
-87 天
-3430 天
帖子存档
6 098
❓ اقتران 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 098
❓ do-while تُنفَّذ مرة على الأقل
do-while runs at least once
int i = 5;
do { i++; } while (i < 5);
System.out.println(i);6 098
Repost from قهوة مبرمجين
مبرمج ترك شغله عشان يصير كهربائي 💔
مطور عمره 31 سنة ضبح من الاجتماعات اللي ما تخلص ومن الكمبيوتر ومن الشغل المؤسسي اللي بلا معنى. المسكين كان ياخذ 95 ألف دولار زائد بونص 10% بس كان يبي يشتغل بيده ويشوف نتيجة ملموسة. عشان كذا قرر يترك كل شي وقدم على التدريب في نقابة الكهربائيين.
احترق في شغل فقرر يحترق في شغل ثاني 😅
6 098
🎁 MACZO GIVEAWAY ALERT 🎁
Enter code:
🔥 CODE158879 🔥
and claim 200 FREE SPINS instantly! 🎰
👥 Limited to the first 200 users only
⚡ Once they’re gone, they’re gone — no second round!
Redeem now and start spinning immediately!
👉 @maczo_official_global
👉 maczo.co
6 098
❓ ما ناتج الجمع مع 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 098
❓ استخدام 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());6 098
❓ إخفاء الحقول (Field Hiding)
Field hiding resolution
class A { int v = 1; }
class B extends A { int v = 2; }
B b = new B();
System.out.println(((A)b).v);6 098
❓ ترتيب التهيئة: static ثم instance ثم constructor
Initialization order
class X {
static { System.out.print("S"); }
{ System.out.print("I"); }
X(){ System.out.print("C"); }
}
new X();6 098
❓ تفضيل التحويلات في Overload
Overload preference (widening vs boxing vs varargs)
static void m(long x){ System.out.print("long"); }
static void m(Integer x){ System.out.print("Integer"); }
static void m(int... x){ System.out.print("varargs"); }
m(5);6 098
❓ الاستثناءات المُتَحَقَّقة (Checked)
Checked exceptions handling
void read() throws java.io.IOException {}
void m(){ read(); }