جافا Java
Open in Telegram
ليس عيبًا ألا تعرف شيئًا، ولكن العيب انك لا تريد أن تتعلم
Show more6 339
Subscribers
+324 hours
-97 days
-4730 days
Posts Archive
6 339
❓ أي overload يُستدعى؟
Which overload is invoked?
void print(int x) { System.out.println("int"); }
void print(Integer x) { System.out.println("Integer"); }
Integer n = null;
print(n);6 339
❓ ما ناتج السويتش بدون break؟
What is the output (no breaks before case 3)?
int n = 2;
switch (n) {
case 1: System.out.print('A');
case 2: System.out.print('B');
case 3: System.out.print('C'); break;
default: System.out.print('D');
}6 339
❓ ما مجموع الأعداد من 1 إلى 3؟
What does this loop print?
int sum = 0;
for (int i = 1; i <= 3; i++) {
sum += i;
}
System.out.println(sum);6 339
❓ ما ناتج الكود التالي؟
What is the output of the following code?
int x = 5;
if (x > 3) x++;
if (x == 6) x += 2;
System.out.println(x);6 339
❓ خطأ فهرسة في حلقة
Index error in loop
int[] a = {1,2,3};
for (int i = 0; i <= a.length; i++) {
System.out.print(a[i]);
}6 339
❓ ترتيب كتل static مع الوراثة
Static init order with inheritance
class A { static { System.out.print("A"); } }
class B extends A { static { System.out.print("B"); } }
new B();6 339
❓ Stream على مصفوفة
Stream over array
int[] a = {1,2,3};
int[] b = java.util.Arrays.stream(a).map(x -> x * 2).toArray();
System.out.println(a[1] + "," + b[1]);6 339
❓ التحويل التلقائي مع Integer
Autoboxing side effect
void bump(Integer x){ x++; }
Integer v = 1;
bump(v);
System.out.println(v);6 339
❓ ملء المصفوفة بـ Arrays.fill
Arrays.fill
int[] a = new int[4];
java.util.Arrays.fill(a, 2);
System.out.println(a[3]);6 339
❓ String.intern والمسبح
String pool with intern
String a = "hi";
String b = new String("hi").intern();
System.out.println(a == b);
Available now! Telegram Research 2025 — the year's key insights 
