This section presents you various set of Mock Tests related to Java 8. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Q 1 - Which of the following is correct about Java8?
A - Lambda expression - Adds functional processing capability to Java.
C - Default method - Interface to have default method implementation.
All of the above options are correct.
Q 2 - Which of the following is correct about Java8?
A - New compiler tools and utilities are added like 'jdeps' to figure out dependencies.
B - New stream API to facilitate pipeline processing is added.
All of the above options are correct.
Q 3 - Which of the following is correct about Java 8 lambda expression?
Both of the above options are correct.
Q 4 - Which of the following is correct about Java 8 lambda expression?
Both of the above options are correct.
Q 5 - Which of the following is correct about Java 8 lambda expression?
A - Lambda expressions are used primarily to define inline implementation of a functional interface.
Both of the above options are correct.
Q 6 - Which of the following is correct about Java 8 lambda expression?
B - Lambda expression throws a compilation error, if a variable is assigned a value the second time.
Both of the above options are correct.
Q 7 - Which of the following is correct about Java 8 method references?
A - Method references help to point to methods by their names.
B - A method reference is described using :: (double colon) symbol.
Both of the above options are correct.
Q 8 - Which of the following is correct about System.out::println expression?
System.out::println method is a static method reference to println method of out object of System class.
Q 9 - Which of the following functional interface represents an operation that accepts two input arguments, and returns no result?
BiConsumer<T,U> functional interface represents an operation that accepts two input arguments, and returns no result.
Q 10 - Which of the following functional interface represents an operation that accepts two input arguments, and returns a result?
BiFunction<T,U> functional interface represents an operation that accepts two input arguments, and returns a result.
Q 11 - Which of the following functional interface represents an operation upon two operands of the same type, producing a result of the same type as the operands?
BinaryOperator<T> functional interface represents an operation upon two operands of the same type, producing a result of the same type as the operands.
Q 12 - Which of the following functional interface represents a predicate (Boolean-valued function) of two arguments?
BiPredicate<T,U> functional interface represents a predicate (Boolean-valued function) of two arguments.
Q 13 - Which of the following functional interface represents a supplier of Boolean-valued results?
BooleanSupplier functional interface represents a supplier of Boolean-valued results.
Q 14 - Which of the following functional interface represents an operation that accepts a single input argument and returns no result?
Consumer<T> functional interface represents an operation that accepts a single input argument and returns no result.
Q 15 - Which of the following functional interface represents an operation upon two double-valued operands and producing a double-valued result?
DoubleBinaryOperator functional interface represents an operation upon two double-valued operands and producing a double-valued result.
Q 16 - Which of the following functional interface represents an operation that accepts a single double-valued argument and returns no result?
DoubleConsumer functional interface represents an operation that accepts a single double-valued argument and returns no result.
Q 17 - Which of the following functional interface represents a function that accepts a double-valued argument and produces a result?
DoubleFunction<R> functional interface represents a function that accepts a double-valued argument and produces a result.
Q 18 - Which of the following functional interface represents a predicate of one double-valued argument?
DoublePredicate functional interface represents a predicate (Boolean-valued function) of one double-valued argument.
Q 19 - Which of the following functional interface represents a supplier of double-valued results?
DoubleSupplier functional interface represents a supplier of double-valued results.
Q 20 - Which of the following functional interface represents a function that accepts a double-valued argument and produces an int-valued result?
DoubleToIntFunction functional interface represents a function that accepts a double-valued argument and produces an int-valued result.
Q 21 - Which of the following functional interface represents a function that accepts a double-valued argument and produces a long-valued result?
DoubleToLongFunction functional interface represents a function that accepts a double-valued argument and produces a long-valued result.
Q 22 - Which of the following functional interface represents an operation on a single double-valued operand that produces a double-valued result?
DoubleUnaryOperator functional interface represents an operation on a single double-valued operand that produces a double-valued result.
Q 23 - Which of the following functional interface represents a function that accepts one argument and produces a result?
Function<T,R> functional interface represents a function that accepts one argument and produces a result.
Q 24 - Which of the following functional interface represents an operation upon two int-valued operands and produces an int-valued result?
FunctionIntBinaryOperator functional interface represents an operation upon two int-valued operands and produces an int-valued result.
Q 25 - Which of the following functional interface represents an operation that accepts a single int-valued argument and returns no result?
IntConsumer functional interface represents an operation that accepts a single int-valued argument and returns no result.
Question Number | Answer Key |
---|---|
1 | D |
2 | D |
3 | C |
4 | C |
5 | C |
6 | C |
7 | C |
8 | A |
9 | A |
10 | B |
11 | C |
12 | D |
13 | A |
14 | B |
15 | C |
16 | D |
17 | A |
18 | B |
19 | C |
20 | D |
21 | A |
22 | B |
23 | C |
24 | D |
25 | A |