Java 8 MCQ Online Test – Part 2
This collection of Java Multiple Choice Questions and Answers (MCQs): Quizzes & Practice Tests with Answer focuses on “Java 8”.
1. Which Java 8 APIs support sequential and parallel aggregation operations?
A Big-data
B Hadoop
C SequenceProgramming
D Streams
2. Stream operations in java 8 can be divided into _____
A Terminal operation
B Intermediate operation
C Both A and B are true.
D None of the above
3. What does Files.lines(Path path)
do?
A It reads all files at the specified path as a string
B It reads all lines of a file as Stream
C It reads file names at the specified path
D It counts the number of lines for files at the specified path
4. What is the purpose of the Optional object?
A Optional is used for an optional argument
B Optional is used to represent null with an absent value
C Optional means that it is not mandatory for the method to return the object
D All the answers are true
5. What is the successor to Rhino Javascript Engine in Java 8?
A Narcissus
B TypeScript
C V8
D Nashorn
6. What does SAM mean in the context of the functional interface?
A Simple Abstract Markup
B Simple Active Markup
C Single Abstract Method
D Single Ambivalue Method
7. Nashorn the new JavaScript engine is an implementation of ____
A javax.engine.Engine
B javax.script.Engine
C javax.javaScript.Engine
D javax.script.ScriptEngine
8. What is the new command line tool for the Nashorn JavaScript engine in java 8?
A jcs
B jfs
C jjs
D jss
9. In which package we can find Predicate in Java 8?
A java.util.predicate
B java.util.object
C java.util.objects
D java.util.predict
10. In java 8, Function is ________
A A class
B An interface
C A lambda expression
D An object
11. Which of the following is an aggregation operator in Java 8?
A filter
B forEach
C map
D All the answers are true
12. Which of the following takes an argument and produces a result in Java 8?
A Process
B Method
C JavaFunctions
D Function
13. In java 8, Predicate is ________
A A class
B An interface
C A lambda expression
D An object
14. What method can be used to check for null on an Optional variable in Java 8?
A isPresent()
B isNullable()
C isPresentable()
D isNotNull()