What is the purpose of garbage collection in Java, and how does it work?
ما هو الغرض من جمع القمامة في جافا، وكيف يعمل؟
ما هو الغرض من جمع القمامة في جافا، وكيف يعمل؟
Which of these data types is used to store a single character in Java?
Anonymous Quiz
11%
String
80%
Char
8%
Character
1%
Text
Consider the code:
What concept of OOP does this demonstrate?
ضع في اعتبارك الكود:
ما هو المفهوم الذي يوضحه هذا الكود في البرمجة الشيئية؟
class Animal {
void sound() {
System.out.println("Animal sound");
}}
class Dog extends Animal {
void sound() {
System.out.println("Bark");
}} What concept of OOP does this demonstrate?
ضع في اعتبارك الكود:
class Animal {
void sound() {
System.out.println("Animal sound");
}}
class Dog extends Animal {
void sound() {
System.out.println("Bark");
}} ما هو المفهوم الذي يوضحه هذا الكود في البرمجة الشيئية؟
How do you declare a variable in Java?
Anonymous Quiz
83%
dataType variableName;
3%
variableName dataType;
7%
dataType: variableName;
7%
declare variableName as dataType;
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];