ch
Feedback
جافا Java

جافا Java

前往频道在 Telegram

ليس عيبًا ألا تعرف شيئًا، ولكن العيب انك لا تريد أن تتعلم

显示更多
6 325
订阅者
-324 小时
-127
-6030
帖子存档
Fix the error in the following Java code snippet to correctly declare and initialize an array of integers.
int[] numbers = {1, 2, 3, 4, 5;
أصلح الخطأ في الشفرة البرمجية جافا التالية لتعريف وتهيئة مصفوفة من الأعداد الصحيحة بشكل صحيح.

How do you define an enum in Java?
Anonymous voting

What will be the output of the following Java code snippet that demonstrates static method overriding?
class Parent {
    static void show() {
        System.out.println("Parent's show()");
    }
}
class Child extends Parent {
    static void show() {
        System.out.println("Child's show()");
    }
}
public class Test {
    public static void main(String[] args) {
        Parent obj = new Child();
        obj.show();
    }
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي توضح إعادة تعريف الطريقة الثابتة؟

Which of these is a correct example of method overloading in Java?
Anonymous voting

What is the output of the following Java code snippet that uses array of objects?
class Student {
    String name;
    Student(String name) {
        this.name = name;
    }
}
public class Test {
    public static void main(String[] args) {
        Student[] students = {new Student("John"), new Student("Jane")};
        for(Student student : students) {
            System.out.println(student.name);
        }
    }
}
ما هو مخرج الشفرة البرمجية جافا التالية التي تستخدم مصفوفة من الكائنات؟

What does the `this` keyword refer to in Java?
Anonymous voting

Identify and correct the error in the following Java code snippet to demonstrate the correct use of an abstract class.
abstract class Animal {
    abstract void eat();
}
class Dog extends Animal {
    void eat() {
        System.out.println("Dog eats");
    }
}
public class TestAnimal {
    public static void main(String[] args) {
        Animal a = new Dog();
        a.eat();
    }
}
حدد وصحح الخطأ في الشفرة البرمجية جافا التالية لتوضيح الاستخدام الصحيح للصف المجرد.

Which of these is not a valid reason for using methods in Java?
Anonymous voting

منصه JetBrains نزلت استبيان اتوقع بيفتحون منصه كورسات اللي يجاوب على الاستبيان فيه جوائز كثيره مثل اللي بالصوره ادخلوا جاوبوا
منصه JetBrains نزلت استبيان اتوقع بيفتحون منصه كورسات اللي يجاوب على الاستبيان فيه جوائز كثيره مثل اللي بالصوره ادخلوا جاوبوا https://surveys.jetbrains.com/s3/computer-science-learning-curve-survey-sh?pcode=796954345361784390

Fix the error in the following Java code snippet to correctly declare and initialize an array of integers.
int[] numbers = {1, 2, 3, 4, 5;
أصلح الخطأ في الشفرة البرمجية جافا التالية لتعريف وتهيئة مصفوفة من الأعداد الصحيحة بشكل صحيح.

Which keyword in Java is used to create a subclass from a superclass?
Anonymous voting

رمضان كريم أعاده الله علينا وعليكم بالخير واليمن والبركات ❤️

What will be the output of the following Java code snippet that demonstrates the use of static variables?
class Counter {
    static int count = 0;
    Counter() {
        count++;
        System.out.println(count);
    }
}
public class TestCounter {
    public static void main(String[] args) {
        Counter c1 = new Counter();
        Counter c2 = new Counter();
        Counter c3 = new Counter();
    }
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي توضح استخدام المتغيرات الثابتة؟

What will the following code snippet print? ```java if (false) { System.out.println("True"); } else { System.out.println("False"); } ```
Anonymous voting

What will be the output of the following Java code snippet that uses a while loop?
int x = 0;
while(x < 5) {
    System.out.print(x + " ");
    x++;
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي تستخدم حلقة while؟

How do you declare a constant in Java?
Anonymous voting

Fix the error in the following Java code snippet to correctly iterate over an array using a for loop.
int[] arr = {1, 2, 3, 4, 5};
for(int i = 0; i <= arr.length; i++) {
    System.out.println(arr[i]);
}
أصلح الخطأ في الشفرة البرمجية جافا التالية لتكرار على مصفوفة باستخدام حلقة for بشكل صحيح.

What is the correct way to declare a variable to store an integer value in Java?
Anonymous voting