Java8 Innards
Java8 Innards
Runnable r--correct
Functional Programming--correct
@Override
public String add(Function<String, String> f) {
return f.apply("Welcome ");
}
@Override
public void add(Consumer<Integer> f) {}
} On calling add() method as described below, String r = adderImpl.add(a -> a + "
lambda"); System.out.println(r);
Runtime error--correct
Code as data--correct
True--correct
Both--correct
False--correct
compilation error--correct
Consumer--correct
IntToLongFunction--correct
Which of the following functional interface represents an operation upon two long-
valued operands and produces a long-valued result?
LongBinaryOperator--correct
False--correct
What functional interface would you use for the following? No parameters , returns
a value
Supplier--correct
True--correct
ObjIntConsumer--correct
Predicate--correct
False--correct
Both--correct
If you wanted to process a stream of names, extract the male names, and store them
in a new List, What is the appropriate operation to be used?
Stream.collect--correct
java.util.stream---correct
False--correct
Terminal operation--correct
False--correct
@NotBlank--correct
getAnnotationsByType()--correct
package functionalInterfaceExample;
@FunctionalInterface
public interface MyFirstFunctionalInterface {
public void firstWork();
@Override
public String toString();
@Override
public boolean equals(Object obj);
}
True--correct
Intermediate operation--correct
DateTimeFormatter formatter=DateTimeFormatter.ofPattern("EEEE",Locale.US);
System.out.println(formatter.format(LocalDateTime.now()));
Choose the correct output.
Friday--correct
java.time--correct
Clock--correct
False--correct
RxJava--correct
Which of the following can be a valid input for jdeps dependency analyzer?
jdeps--correct
Which methods preserve parameter names in Java bytecode (through reflection API)
All methods--wrong