جافا Java
رفتن به کانال در Telegram
ليس عيبًا ألا تعرف شيئًا، ولكن العيب انك لا تريد أن تتعلم
نمایش بیشتر6 166
مشترکین
-324 ساعت
-147 روز
-6930 روز
آرشیو پست ها
6 164
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());
حدد وأصلح الخطأ في الشفرة البرمجية جافا التالية لكي تطبع بشكل صحيح طول المصفوفة.6 164
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");
}
}
صحح الخطأ في الشفرة البرمجية جافا التالية لتوضيح المفهوم المجرد.6 164
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!");
}
}
حدد وأصلح الخطأ في الشفرة البرمجية جافا التالية لجعلها تترجم بنجاح.6 164
Which of the following is the correct way to define a constructor for a class named `Book` in Java?
6 164
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();
}
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي توضح إعادة تعريف الطريقة الثابتة؟6 164
Correct the following Java code snippet to use the 'final' keyword appropriately.
class Car {
final int MAX_SPEED;
Car() {
MAX_SPEED = 120;
}
}
صحح الشفرة البرمجية جافا التالية لاستخدام كلمة 'final' بشكل مناسب.6 164
What is the default value of an int variable declared as an instance variable in a class in Java?
6 164
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");
}
}
حدد مخرج الشفرة البرمجية جافا التالية التي توضح مفهوم تحميل الطريقة.6 164
What is the default value of an object reference declared as an instance variable in Java?
6 164
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
}
صحح الخطأ في الشفرة البرمجية جافا التالية التي تحاول تنفيذ واجهات متعددة.6 164
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();
}
}
فكر في الشفرة البرمجية جافا التالية. ماذا سيكون المخرج؟6 164
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؟6 164
How do you initialize an array of integers with the size of 5 in Java?
6 164
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؟