Java Basic
- What does Files.lines(Path path) do?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Files.lines(Path path) that reads all lines from a file as a Stream.
- What is Optional object used for?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Optional object is used to represent null with absent value. This class has various utility methods to facilitate code to handle values as ‘available’ or ‘not available’ instead of checking null values.
- Which of the following methods hits database always?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
get() method hits database always. Also, get() method does not return proxy object.
- Which of the following methods returns proxy object?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
load() method returns proxy object. load() method should be used if it is sure that instance exists.
- SessionFactory is a thread-safe object.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
SessionFactory is a thread-safe object. Multiple threads can access it simultaneously.