What happens if we call get() on an empty optional?
Anonymous Quiz
22%
Nothing
42%
NoSuchElementException
32%
NullPointerException
4%
Answer
🤔8👍2
👍8
👍2
What cannot be used with the synchronized keyword?
Anonymous Quiz
11%
method instance
22%
method static
12%
block
43%
constructor
13%
Answer
👍2
How does describe the relations between the class Animal and Tiger?
Anonymous Quiz
28%
Has a
65%
Is a
7%
Answer
🤔7👍2
What happens if we call get() on an empty optional?
Anonymous Quiz
40%
NullPointerException
34%
NoSuchElementException will be thrown
21%
Nothing
5%
Answer
👍7🤔4👏1
😁13🤯11🤔8👍2
❤5😁2
What types of blocks don't exist in Java?
Anonymous Quiz
10%
Static initialization block
7%
Initialization block
34%
Local block
39%
All options above are valid
10%
Answer
👍8
What does the method offer() to do? Queue interface.
Anonymous Quiz
36%
Carry the element to the end of the queue
17%
Take the element and delete it
34%
Just take the element
13%
Answer
👍3
👍4
🤔5👍3
😁3🔥2
Java задачи • Mentor
Is the finally block always executed?
☝️ Explanation:
The final block is always executed unless there is an abnormal termination of the program, either as a result of a JVM failure or calling the System.exit(0)
The final block is always executed unless there is an abnormal termination of the program, either as a result of a JVM failure or calling the System.exit(0)
👍4🤯4
What is the result of the next code? for(;;)
Anonymous Quiz
9%
This code will not be executed
75%
Infinity cycle
12%
Compile error
5%
Runtime error
👍7👏1
What is the result for the next code? public static void main(String[] args) {
String test = new String("Hello"); String test2 = new String("Hello"); System.out.println(test==test2); }
String test = new String("Hello"); String test2 = new String("Hello"); System.out.println(test==test2); }
Anonymous Quiz
8%
null
2%
Hello
67%
false
22%
true