What is the output of the Java code above?
Anonymous Quiz
18%
The code does not compile.
43%
The code throws an exception called "ArrayIndexOutOfBoundsException".
26%
16
12%
16.0
👍5😁1
Which topic of Java do you need to learn MOST? Please, vote this poll so that we can post questions which you need.
Optionally, you may select two or more options. Please select topics you need to learn 'ONLY'
Optionally, you may select two or more options. Please select topics you need to learn 'ONLY'
Anonymous Poll
42%
Inheritance
24%
Pritimive data types
26%
Assignment
51%
Try-catch and/or Thread
35%
Methods
76%
ArrayList, List, HashSet, HashMap (Collections)
41%
Interface and/or enum
25%
Operators
14%
Others (write in comment)
👍8
In Java, what is the output of the code snippet above?
Anonymous Quiz
48%
The student: Student and the student has 300 dollars.
29%
The code does not compile.
23%
The code throws an exception called "InterruptedException".
👍4
What is the output of the code above?
Anonymous Quiz
31%
The code does not compile due to Line X.
36%
The code does not compile because variables "age" and "float" are defined with protected keyword.
32%
The result: 17.75
❤1
In Java, which keyword is used to implement inheritance between classes?
Anonymous Quiz
61%
extends
27%
implements
7%
new
5%
super
👍3🥰2❤1
👍4
What is the purpose of the "equals()" method in Java?
Anonymous Quiz
43%
To compare two objects for reference equality.
22%
To compare two objects for structural equality.
15%
To compare two objects for memory allocation.
19%
To compare two objects for data type compatibility.
👍8
Which data structure uses the "First-In-First-Out" (FIFO) principle?
Anonymous Quiz
34%
Stack
55%
Queue
8%
arraylist
3%
hashset
👍9👏3💯3🥰2🤔1
What is the correct way to declare a constant in Java?
Anonymous Quiz
26%
constant int x =5;
47%
final int x =5;
16%
int final x = 5;
11%
int x = constant 5 ;
👍9🔥1
What is the purpose of the NullPointerException in Java?
Anonymous Quiz
28%
It is thrown when an arithmetic operation results in an undefined value.
51%
It is thrown when a null reference is accessed.
12%
It is thrown when a method is not found.
9%
It is thrown when the program runs out of memory.
👍9🥰2
Which feature introduced in Java 8 allows you to write more concise and expressive code for handling collections?
Anonymous Quiz
23%
Enhanced for loop
20%
Generics
44%
Lambda expressions
12%
Method references
👍7👏1
In Java 11, which module was introduced to provide a standard API for working with HTTP clients and servers?
Anonymous Quiz
24%
21%
32%
java.http
23%
java.net.http
👍8
In Java, which feature is used to define methods that can accept variable-length argument lists?
Anonymous Quiz
11%
Variadic functions
40%
Variable functions
21%
Varargs
28%
Variable methods
👍5
Which feature, introduced in Java 12, allows the JVM to allocate and deallocate memory more efficiently for small objects?
Anonymous Quiz
45%
Switch Expressions
17%
Shenandoah GC
23%
Value Types
15%
Compact Strings
👏4❤1
Can an interface have static methods in Java?
Anonymous Quiz
54%
Yes, with the static keyword.
22%
No, static methods are not allowed in interfaces.
17%
Yes, with the abstract keyword.
7%
No, interfaces can only have instance methods.
👏4
👍4
Which of the following is the return type of the lines() method in the java.nio.file.Files class?
Anonymous Quiz
33%
Stream<String>
20%
List<String>
11%
Set<String>
16%
Map<String, String>
21%
None of the above
❤6👍4👏1
What is the purpose of the 'record' keyword introduced in Java 16?
Anonymous Quiz
43%
It creates a new record in a database.
25%
It defines a new type of class for storing records.
17%
It's a replacement for the 'enum' keyword.
15%
It's used to create classes for immutable data with automatic methods.
👍5😈2🔥1😁1