What is the use of the 'final' keyword when applied to a variable in Java?
ما هو استخدام كلمة 'final' عند تطبيقها على متغير في جافا؟
ما هو استخدام كلمة 'final' عند تطبيقها على متغير في جافا؟
In Java, what is the result of using '==' to compare two strings 'str1' and 'str2'?
Anonymous Quiz
39%
It compares the value of the strings
39%
It compares the reference of the strings
13%
It always returns true
8%
It always returns false
What will be the output of the following Java code snippet?
ماذا سيكون مخرجات قطعة الكود الجافا التالية؟
String[] animals = {"Dog", "Cat", "Horse"};
for(String animal : animals) {
System.out.println(animal);
} ماذا سيكون مخرجات قطعة الكود الجافا التالية؟
String[] animals = {"Dog", "Cat", "Horse"};
for(String animal : animals) {
System.out.println(animal);
}What is 'Stream API' in Java 8 used for?
Anonymous Quiz
42%
File I/O operations
10%
Creating threads
34%
Processing collections of objects in a functional manner
14%
Memory management
What is the use of the 'new' keyword in Java?
ما هو استخدام كلمة 'new' في جافا؟
ما هو استخدام كلمة 'new' في جافا؟
How do you access the third element in an array named 'myArray'?
Anonymous Quiz
65%
myArray[2];
20%
myArray[3];
13%
myArray.get(2);
2%
myArray(2);
What is the purpose of the 'transient' keyword in Java?
Anonymous Quiz
31%
To declare variables that cannot be serialized
19%
To make variables static
42%
To indicate that a variable is thread-safe
8%
To make a variable a constant
❤1
Explain the difference between static and non-static methods in Java.
شرح الفرق بين الطرق الثابتة وغير الثابتة في جافا.
شرح الفرق بين الطرق الثابتة وغير الثابتة في جافا.
What does the 'static' keyword in Java signify?
Anonymous Quiz
24%
The method or variable belongs to the instance of a class
36%
The method or variable is constant and cannot be changed
32%
The method or variable belongs to the class rather than any instance
8%
The method or variable will be automatically garbage collected
What is the output of the following Java code snippet?
String str = "Java";
System.out.println(str.concat("Quiz"));
String str = "Java";
System.out.println(str.concat("Quiz"));
Anonymous Quiz
12%
"Java"
9%
"Quiz"
65%
"JavaQuiz"
14%
An error occurs
🔥6
In Java, which of these keywords is used to inherit methods and properties from a superclass?
Anonymous Quiz
23%
super
12%
this
53%
extends
12%
implements
❤2👍1
Which of the following is a valid way to create a thread in Java?
Anonymous Quiz
24%
By implementing the Runnable interface
28%
By extending the Thread class
7%
By using the ExecutorService
42%
Both A and B are correct
👍1
Which of the following is a valid declaration of a two-dimensional array in Java?
Anonymous Quiz
67%
int[][] array2D = new int[3][3];
19%
int array2D[][] = new int[][];
9%
int[] array2D = new int[3][3];
5%
int array2D[][] = new int[3];
Identify and fix the error in the following Java code snippet:
حدد وأصلح الخطأ في قطعة الكود الجافا التالية:
public class Main {
public static void Main(String[] args) {
System.out.println("Hello, world!");
}
} حدد وأصلح الخطأ في قطعة الكود الجافا التالية:
public class Main {
public static void Main(String[] args) {
System.out.println("Hello, world!");
}
}👍2
In Java, which of the following is a checked exception?
Anonymous Quiz
27%
NullPointerException
27%
ArrayIndexOutOfBoundsException
26%
IOException
20%
ArithmeticException
What is the purpose of a constructor in a Java class?
ما هو الغرض من منشئ في فئة جافا؟
ما هو الغرض من منشئ في فئة جافا؟
What is the purpose of the 'final' keyword when applied to a variable in Java?
Anonymous Quiz
78%
To create a constant variable
8%
To improve performance
8%
To allow variable value changes
6%
To make the variable public