جافا Java
6.46K subscribers
212 photos
18 videos
81 files
269 links
ليس عيبًا ألا تعرف شيئًا، ولكن العيب انك لا تريد أن تتعلم
Download Telegram
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
}



صحح الخطأ في الشفرة البرمجية جافا التالية التي تحاول تنفيذ واجهات متعددة.
What is the default value of an object reference declared as an instance variable in Java?
Anonymous Quiz
65%
null
16%
0
7%
undefined
12%
Not assigned
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");
}
}



حدد مخرج الشفرة البرمجية جافا التالية التي توضح مفهوم تحميل الطريقة.
2
What is the default value of an int variable declared as an instance variable in a class in Java?
Anonymous Quiz
72%
0
4%
1
19%
null
4%
Not initialized
Correct the following Java code snippet to use the 'final' keyword appropriately.

class Car {
final int MAX_SPEED;
Car() {
MAX_SPEED = 120;
}
}



صحح الشفرة البرمجية جافا التالية لاستخدام كلمة 'final' بشكل مناسب.
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();
}
}



ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي توضح إعادة تعريف الطريقة الثابتة؟
👍1
Which of the following is the correct way to define a constructor for a class named `Book` in Java?
Anonymous Quiz
46%
public Book() {}
24%
Book() {}
28%
public void Book() {}
1%
void Book() {}
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!");
}
}



حدد وأصلح الخطأ في الشفرة البرمجية جافا التالية لجعلها تترجم بنجاح.
👍1
Which of these array declarations is not valid in Java?
Anonymous Quiz
17%
int[] arr = new int[5];
11%
int arr[] = new int[5];
47%
int arr[5];
25%
Both A and B are correct
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");
}
}



صحح الخطأ في الشفرة البرمجية جافا التالية لتوضيح المفهوم المجرد.
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());



حدد وأصلح الخطأ في الشفرة البرمجية جافا التالية لكي تطبع بشكل صحيح طول المصفوفة.
👍1
Which method is called when an object is created in Java?
Anonymous Quiz
10%
init()
31%
main()
7%
start()
51%
constructor
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؟
1
What is the correct way to declare a variable of type double in Java?
Anonymous Quiz
89%
double num = 10.5;
6%
Double num = 10.5;
4%
double num = '10.5';
1%
double num = "10.5";
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 is the correct syntax to declare a class named 'Vehicle' in Java?
Anonymous Quiz
24%
class Vehicle {}
4%
Class Vehicle {}
41%
public class Vehicle {}
31%
All of the above are correct
What will be the output of the following Java code snippet demonstrating the use of abstract classes?

abstract class Shape {
abstract void draw();
}
class Rectangle extends Shape {
void draw() {
System.out.println("Drawing Rectangle");
}
}
public class Test {
public static void main(String[] args) {
Shape shape = new Rectangle();
shape.draw();
}
}



ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي توضح استخدام الصفوف المجردة؟
1
اختر الإجابة الخاطئة لتعريف الدوال في جافا
👏2