In Java, which keyword is used to inherit features from a class?
Anonymous Quiz
70%
extends
5%
inherits
16%
super
8%
this
How do you ensure a class in Java is not inherited by any other class?
كيف تضمن ألا يتم وراثة فئة في جافا من قبل أي فئة أخرى؟
كيف تضمن ألا يتم وراثة فئة في جافا من قبل أي فئة أخرى؟
How do you declare a method in Java that takes an integer as input and returns an integer?
Anonymous Quiz
67%
int functionName(int input);
10%
functionName(int input): int;
15%
int input functionName();
8%
function int functionName(int input);
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!");
}
}👍1
What will the following Java code snippet print?
```java
int[] numbers = {1, 2, 3, 4, 5}; for(int i : numbers) { System.out.print(i + " "); } ```
```java
int[] numbers = {1, 2, 3, 4, 5}; for(int i : numbers) { System.out.print(i + " "); } ```
Anonymous Quiz
56%
1 2 3 4 5
13%
1, 2, 3, 4, 5
8%
12345
23%
An error because the syntax is incorrect
🙏1
In Java, what is a 'stream' and how is it typically used?
في جافا، ما هو 'تيار' وكيف يستخدم عادة؟
في جافا، ما هو 'تيار' وكيف يستخدم عادة؟
What is the output of the following Java code snippet?
```java
int a = 9, b = 4; if (a > 10) { b = b + 1; } else { b = b - 1; } System.out.println(b); ```
```java
int a = 9, b = 4; if (a > 10) { b = b + 1; } else { b = b - 1; } System.out.println(b); ```
Anonymous Quiz
75%
3
14%
4
8%
5
3%
0
How can you ensure a class cannot be subclassed in Java?
Anonymous Quiz
51%
By declaring the class as `final`
26%
By using the `private` access modifier on the class
11%
By not providing any constructors
11%
By declaring all methods as `final`
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.
ما هو 'تعبير لامبدا' في جافا، وأعط مثالاً.
ما هو 'تعبير لامبدا' في جافا، وأعط مثالاً.