en
Feedback
جافا Java

جافا Java

Open in Telegram

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

Show more
6 163
Subscribers
-324 hours
-147 days
-6930 days
Posts Archive
Which method is called when an object is created in Java?
Anonymous voting

Identify and fix the error in the following Java code snippet so it correctly prints the length of the array.
int[] numbers = new int[5];
System.out.println(numbers.length());
حدد وأصلح الخطأ في الشفرة البرمجية جافا التالية لكي تطبع بشكل صحيح طول المصفوفة.

What is polymorphism in Java?
Anonymous voting

Correct the error in the following Java code snippet to demonstrate abstraction.
abstract clas Vehicle {
    abstract void start();
}
class Car extends Vehicle {
    void start() {
        System.out.println("Car starts with a key");
    }
}
صحح الخطأ في الشفرة البرمجية جافا التالية لتوضيح المفهوم المجرد.

Which of these array declarations is not valid in Java?
Anonymous voting

Identify and fix the error in the following Java code snippet to make it compile successfully.
public clas HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
حدد وأصلح الخطأ في الشفرة البرمجية جافا التالية لجعلها تترجم بنجاح.

Which of the following is the correct way to define a constructor for a class named `Book` 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 the following is true about static methods in Java?
Anonymous voting

Correct the following Java code snippet to use the 'final' keyword appropriately.
class Car {
    final int MAX_SPEED;
    Car() {
        MAX_SPEED = 120;
    }
}
صحح الشفرة البرمجية جافا التالية لاستخدام كلمة 'final' بشكل مناسب.

What is the default value of an int variable declared as an instance variable in a class in Java?
Anonymous voting

Identify the output of the following Java code snippet that demonstrates the concept of method overloading.
class Display {
    void show(int a) {
        System.out.println("Integer: " + a);
    }
    void show(String b) {
        System.out.println("String: " + b);
    }
}
public class Test {
    public static void main(String[] args) {
        Display obj = new Display();
        obj.show(10);
        obj.show("Java");
    }
}
حدد مخرج الشفرة البرمجية جافا التالية التي توضح مفهوم تحميل الطريقة.

What is the default value of an object reference declared as an instance variable in Java?
Anonymous voting

Correct the error in the following Java code snippet that tries to implement multiple interfaces.
interface FirstInterface {
    void firstMethod();
}
interface SecondInterface {
    void secondMethod();
}
class MyClass implements FirstInterface, SecondInterface {
    public void firstMethod() {
        // implementation
    }
    // Missing implementation for secondMethod
}
صحح الخطأ في الشفرة البرمجية جافا التالية التي تحاول تنفيذ واجهات متعددة.

Which operator is used to compare two values for equality in Java?
Anonymous voting

Consider the following Java code snippet. What will be the output?
class Base {
    void display() {
        System.out.println("Base display()");
    }
}
class Derived extends Base {
    void display() {
        System.out.println("Derived display()");
    }
}
public class Test {
    public static void main(String[] args) {
        Base obj = new Derived();
        obj.display();
    }
}
فكر في الشفرة البرمجية جافا التالية. ماذا سيكون المخرج؟

Which keyword is used to define a class in Java?
Anonymous voting

What will be the output of the following Java code snippet that uses an if-else statement?
int number = 10;
if(number > 10) {
    System.out.println("Number is greater than 10");
} else {
    System.out.println("Number is not greater than 10");
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي تستخدم جملة if-else؟

How do you initialize an array of integers with the size of 5 in Java?
Anonymous voting

What will be the output of the following Java code snippet that uses an if-else statement?
int number = 10;
if(number > 10) {
    System.out.println("Number is greater than 10");
} else {
    System.out.println("Number is not greater than 10");
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي تستخدم جملة if-else؟