❓ كيف يعمل fall-through عندما يطابق case 1؟
How does fall-through work here?
How does fall-through work here?
int d = 1;
switch (d) {
case 0: d += 2;
default: d += 3;
case 1: d += 4;
}
System.out.println(d);
👍2
❓ أي استدعاء يُفضَّل مع varargs؟
Which overload is chosen with varargs?
Which overload is chosen with varargs?
static void m(int x) { System.out.print("exact"); }
static void m(int... x) { System.out.print("varargs"); }
m(5);👍2
❓ ما نتيجة البحث بعد الفرز؟
What is binarySearch result after sort?
What is binarySearch result after sort?
int[] a = {3, 1, 2};
java.util.Arrays.sort(a);
System.out.println(java.util.Arrays.binarySearch(a, 2));❓ ما ناتج حساب المضروب البسيط؟
What does this factorial-like loop print?
What does this factorial-like loop print?
int n = 3, r = 1;
for (int i = 1; i <= n; i++) r *= i;
System.out.println(r);
❓ تأثير العامل الثلاثي مع الزيادات؟
Ternary with increments effect?
Ternary with increments effect?
int a = 1, b = 2;
int x = (a++ > 1) ? a : b++;
System.out.println(a + "," + b + "," + x);
👍1
❓ ما ناتج بناء السلسلة داخل لوب؟
What does this string build print?
What does this string build print?
String s = "a";
for (int i = 0; i < 3; i++) s += i;
System.out.println(s);
👍2
❓ ما طول الصف الثاني؟
What is the length of the second row?
What is the length of the second row?
int[][] m = { {1,2}, {3,4,5} };
System.out.println(m[1].length);👍1
❓ ما مجموع التأثير في switch مع default؟
Total effect in switch with default?
Total effect in switch with default?
int x = 0;
int v = 3;
switch (v) {
case 1: x += 1; break;
case 2:
case 3: x += 3;
default: x += 5; break;
}
System.out.println(x);
👍4
X (formerly Twitter)
التميمي (@altmemy199) on X
شفت كثير طلاب جدد محتارين ايش هو اللابتوب المناسب ايش رايكم اثبت هذي التغريدة وكل واحد يقول مواصفات جهازه وسعره وهل هو مناسب او لا
ثبتت تغريدة بحسابي مرجع لاي احد يفكر يشتري لابتوب ومايعرف اللابتوب المناسب يمكن تساعدكم
https://x.com/altmemy199/status/1962963533945086197?t=-1P58zN5ttkOj5frrr96yA&s=19
https://x.com/altmemy199/status/1962963533945086197?t=-1P58zN5ttkOj5frrr96yA&s=19
❤2
❓ ما قيمة الحقل بعد إنشاء الكائن؟
What is the field value after object creation?
What is the field value after object creation?
class A { int v = 1; A(){ v *= 2; } }
A a = new A();
System.out.println(a.v);