ar
Feedback
جافا Java

جافا Java

الذهاب إلى القناة على Telegram

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

إظهار المزيد
6 163
المشتركون
-324 ساعات
-147 أيام
-6930 أيام
أرشيف المشاركات
What is the correct syntax to declare an interface in Java?
Anonymous voting

Find and correct the error in the following code snippet to correctly implement encapsulation in Java.
class Student {
    private int age;
    public void setAge(int age) {
        if(age > 0) {
            this.age = age;
        }
    }
    public int getAge() {
        return age;
    }
}
جد وصحح الخطأ في الشفرة البرمجية التالية لتنفيذ التغليف بشكل صحيح في جافا.

What does the `instanceof` keyword check?
Anonymous voting

What is the output of the following Java program that demonstrates method overloading?
class DisplayOverloading {
    public void disp(char c) {
        System.out.println(c);
    }
    public void disp(char c, int num) {
        System.out.println(c + " " + num);
    }
}
public class Sample {
    public static void main(String[] args) {
        DisplayOverloading obj = new DisplayOverloading();
        obj.disp('a');
        obj.disp('a', 10);
    }
}
ما هو مخرج البرنامج جافا التالي الذي يوضح إعادة تحميل الطريقة؟

Which collection interface represents a group of objects as a single unit in Java?
Anonymous voting

What is the output of the following code snippet?
int moon = 9, star = 2 + 2 * 3;
float sun = star>10 ? 1 : 3;
double jupiter = (sun + moon) -­ 1.0f;
int mars = -­-­moon <= 8 ? 2 : 3;
System.out.println(sun+", "+jupiter+", "+mars);

Fix the error in the following Java code snippet to correctly compare two strings for equality.
String str1 = "Java";
String str2 = "java";
System.out.println(str1 == str2);
أصلح الخطأ في الشفرة البرمجية جافا التالية لمقارنة سلسلتين نصيتين بشكل صحيح من أجل المساواة.

Which principle of Object-Oriented Programming allows a subclass to provide a specific implementation of a method that is already provided by one of its superclasses?
Anonymous voting

What is the result of executing the following code snippet?
What is the result of executing the following code snippet?

What will be the output of the following Java code snippet that demonstrates the use of the ternary operator?
int a = 10, b = 5;
int result = (a > b) ? a : b;
System.out.println(result);
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي توضح استخدام العامل الثلاثي؟

Which method must be implemented by a class that implements the `java.lang.Runnable` interface?
Anonymous voting

photo content

Fix the error in the following Java code snippet to correctly compare two strings for equality.
String str1 = "Java";
String str2 = "java";
System.out.println(str1 == str2);
أصلح الخطأ في الشفرة البرمجية جافا التالية لمقارنة سلسلتين نصيتين بشكل صحيح من أجل المساواة.

Which keyword is used to declare an array in Java?
Anonymous voting

What is the output
What is the output

Identify and fix the error in the following Java code snippet to correctly demonstrate the concept of an abstract class.
abstract class Animal {
    abstract void eat();
}
class Dog extends Animal {
    void eat() {
        System.out.println("Dog eats food");
    }
}
حدد وأصلح الخطأ في الشفرة البرمجية جافا التالية لتوضيح مفهوم الصف المجرد بشكل صحيح.

Which of the following is not a valid Java data type?
Anonymous voting

Identify and fix the error in the following Java code snippet that attempts to implement polymorphism.
interface Shape {
    void draw();
}
class Circle implements Shape {
    public void draw() {
        System.out.println("Circle drawn");
    }
}
public class TestPolymorphism {
    public static void main(String[] args) {
        Shape shape = new Circle();
        shape.draw();
    }
}
حدد وأصلح الخطأ في الشفرة البرمجية جافا التالية التي تحاول تنفيذ الشكلية البوليمورفية.

What is the output of the following Java code? ```java String str1 = "Java"; String str2 = new String("Java"); System.out.println(str1 == str2); ```
Anonymous voting