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
What is the output of the following code snippet?
int[] array = {1, 2, 3, 4, 5};
System.out.println(array[3]);
int[] array = {1, 2, 3, 4, 5};
System.out.println(array[3]);
Anonymous Quiz
11%
3
82%
4
3%
5
5%
ArrayIndexOutOfBoundsException
❤1👍1
How do you find the length of an array 'arr' in Java?
Anonymous Quiz
34%
arr.length;
6%
arr.size();
51%
arr.length();
9%
length(arr);
❤3
What does the 'break' statement do in a loop in Java?
ماذا تفعل عبارة 'break' في حلقة في جافا؟
ماذا تفعل عبارة 'break' في حلقة في جافا؟
Which method in the 'Object' class is used to clone an object in Java?
Anonymous Quiz
53%
cloneObject()
10%
copy()
33%
clone()
4%
deepCopy()