How can you call a method named `calculateSum` that takes two integers as parameters and returns an integer?
Anonymous Quiz
29%
calculateSum(int a, int b);
28%
int result = calculateSum(a, b);
28%
int result = calculateSum(int a, int b);
16%
calculateSum(a, b);
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
جافا Java
سر نجاح المبرمجين هو الاستمرارية. عندما تواجه تحديات، استمر في العمل، وعندما تحقق إنجازات، استمر في التعلم.
❤5
Which of the following is not a valid way to create a thread in Java?
Anonymous Quiz
27%
By extending the Thread class
22%
By implementing the Runnable interface
31%
By using the ExecutorService
20%
By extending the Runnable interface
True or False: In Java, a 'while' loop is an example of a conditional loop.
صحيح أم خطأ: في جافا، حلقة 'while' هي مثال على حلقة شرطية.
صحيح أم خطأ: في جافا، حلقة 'while' هي مثال على حلقة شرطية.
How do you handle an exception in Java?
Anonymous Quiz
72%
try-catch block
19%
throw-catch block
3%
error-catch block
6%
try-throw block
What is the output of the following Java code?
ما هو مخرجات الكود الجافا التالي؟
int[] arr = {1, 2, 3, 4, 5};
for(int i = 0; i < arr.length; i++) {
System.out.print(arr[i] + " ");
} ما هو مخرجات الكود الجافا التالي؟
int[] arr = {1, 2, 3, 4, 5};
for(int i = 0; i < arr.length; i++) {
System.out.print(arr[i] + " ");
}❤1
What is the return type of a method that does not return any value?
Anonymous Quiz
21%
null
62%
void
8%
0
9%
None of the above
❤1
What is a 'Lambda expression' in Java, and give an example.
ما هو 'تعبير لامبدا' في جافا، وأعط مثالاً.
ما هو 'تعبير لامبدا' في جافا، وأعط مثالاً.
What is the correct way to create a read-only property in a class in Java?
Anonymous Quiz
51%
By using a private field and public getter method
15%
By using a public field
13%
By using a static field
21%
By using a final method
Which of the following is a legal identifier in Java?
Anonymous Quiz
52%
_myVariable
16%
2myVariable
18%
my-variable
14%
my variable
Describe the difference between checked and unchecked exceptions in Java.
وصف الفرق بين الاستثناءات المراقبة وغير المراقبة في جافا.
وصف الفرق بين الاستثناءات المراقبة وغير المراقبة في جافا.
In Java, how do you catch multiple types of exceptions in a single catch block?
Anonymous Quiz
32%
By separating exceptions with a semicolon (;)
32%
By separating exceptions with a comma (,)
20%
By using multiple catch blocks for each exception type
16%
By separating exceptions with a pipe (|)
What is the correct way to create an object of a class named `Vehicle` in Java?
Anonymous Quiz
74%
Vehicle myCar = new Vehicle();
15%
class Vehicle myCar = new Vehicle();
2%
new Vehicle myCar = Vehicle();
8%
Vehicle = new myCar();
❤1
How do you initialize an array of 10 integers to zero in Java?
كيف تقوم بتهيئة مصفوفة من 10 أعداد صحيحة إلى صفر في جافا؟
كيف تقوم بتهيئة مصفوفة من 10 أعداد صحيحة إلى صفر في جافا؟
What will be the output of the following Java code snippet?
```java
int x = 10; int y = ++x; System.out.println(y); ```
```java
int x = 10; int y = ++x; System.out.println(y); ```
Anonymous Quiz
12%
10
80%
11
3%
12
5%
None of the above
What is the difference between 'abstract class' and 'interface' in Java?
ما هو الفرق بين 'الفئة المجردة' و'الواجهة' في جافا؟
ما هو الفرق بين 'الفئة المجردة' و'الواجهة' في جافا؟
👍1