ru
Feedback
جافا Java

جافا Java

Открыть в Telegram

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

Больше
6 325
Подписчики
-324 часа
-127 дней
-6030 день
Архив постов
What will be the output of the following Java code snippet that demonstrates the use of the 'instanceof' keyword?
class Parent {}
class Child extends Parent {}
public class Test {
    public static void main(String[] args) {
        Parent obj = new Child();
        System.out.println(obj instanceof Child);
    }
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي توضح استخدام كلمة 'instanceof'؟

How do you convert a string to an integer in Java?
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();
    }
}
حدد وأصلح الخطأ في الشفرة البرمجية جافا التالية التي تحاول تنفيذ الشكلية البوليمورفية.

How do you achieve abstraction in Java?
Anonymous voting

What will be the output of the following Java program that demonstrates the concept of inheritance?
class Animal {
    String sound() { return "Some sound"; }
}
class Dog extends Animal {
    String sound() { return "Bark"; }
}
public class TestInheritance {
    public static void main(String[] args) {
        Animal myDog = new Dog();
        System.out.println(myDog.sound());
    }
}
ماذا سيكون المخرج للبرنامج جافا التالي الذي يوضح مفهوم الوراثة؟

Which keyword is used to pass an object of a class as its own parameter?
Anonymous voting

photo content

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;
    }
}
جد وصحح الخطأ في الشفرة البرمجية التالية لتنفيذ التغليف بشكل صحيح في جافا.

How do you correctly handle exceptions in Java?
Anonymous voting

Do you enjoy reading this channel? Perhaps you have thought about placing ads on it? To do this, follow three simple steps: 1) Sign up: https://telega.io/c/learn_java_e 2) Top up the balance in a convenient way 3) Create an advertising post If the topic of your post fits our channel, we will publish it with pleasure.

What is the output of the following Java code snippet that demonstrates the concept of inheritance and method overriding?
class Animal {
    String shout() { return "Don't know!"; }
}
class Dog extends Animal {
    String shout() { return "Woof!"; }
}
public class TestAnimal {
    public static void main(String[] args) {
        Animal myAnimal = new Dog();
        System.out.println(myAnimal.shout());
    }
}
ما هو مخرج الشفرة البرمجية جافا التالية التي توضح مفهوم الوراثة وإعادة تعريف الطريقة؟

Which of the following is not a principle of Object-Oriented Programming?
Anonymous voting

What will be the output of the following Java code snippet that uses a switch-case statement?
char grade = 'A';
switch(grade) {
    case 'A':
        System.out.println("Excellent");
        break;
    case 'B':
        System.out.println("Good");
        break;
    default:
        System.out.println("Invalid grade");
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي تستخدم جملة switch-case؟

Which statement correctly creates a two-dimensional array in Java?
Anonymous voting

Fix the error in the following code snippet that defines a class and tries to create an object of it.
public class Bike {
    int speedLimit = 90;
}
public class TestBike {
    public static void main(String[] args) {
        Bike myBike = new Bike();
        System.out.println(myBike.speedLimit);
    }
}
صحح الخطأ في الشفرة البرمجية التالية التي تعرف صفا وتحاول إنشاء كائن منه.

What keyword is used to import a package in Java?
Anonymous voting

Correct the error in the following Java code snippet that attempts to override a method in a subclass.
class SuperClass {
    protected void display() {
        System.out.println("SuperClass display");
    }
}
class SubClass extends SuperClass {
    private void display() {
        System.out.println("SubClass display");
    }
}
صحح الخطأ في الشفرة البرمجية جافا التالية التي تحاول إعادة تعريف طريقة في فئة فرعية.

What is the default value of a static integer variable in Java?
Anonymous voting

Correct the error in the following Java code snippet that defines a method to calculate the sum of two integers.
public int sum(int a, int b) {
    return a + b
}
صحح الخطأ في الشفرة البرمجية جافا التالية التي تعرف طريقة لحساب مجموع عددين صحيحين.

How do you declare a method that does not return any value?
Anonymous voting

جافا Java - Статистика и аналитика Telegram-канала @here_java