Java8 Innards FrescoPlay
Java8 Innards FrescoPlay
m
True
er as
9.public class App{}
co
compilation error
eH w
10.Which of the following is correct about Java 8 lambda expression?
o.
Both
rs e
11.A functional interface acts as target types for which of the following?
ou urc
All the options mentioned
XLambda expression
12.A FunctionalInterface annotation (@FunctionalInterface) is necessary for making an interface a
o
functional interface
aC s
False
vi y re
13.Which of the following functional interface represents a function that accepts an int-valued
argument and produces a long-valued result?
IntToLongFunction
14.Which of the following functional interface represents an operation that accepts an object-valued
ed d
ObjIntConsumer<T>
15.Which of the following functional interface represents an operation that accepts a single input
argument and returns no result?
16.Which of the following functional interface represents an operation that accepts a single input
is
Consumer<T>
17.What functional interface would you use for the following? No parameters , returns a value
Supplier
sh
18.Which of the following functional interface represents an operation upon two long-valued
operands and produces a long-valued result?
LongBinaryOperator
This study source was downloaded by 100000821315344 from CourseHero.com on 09-18-2021 16:10:15 GMT -05:00
https://www.coursehero.com/file/77195709/Java8-Innards-FrescoPlaydocx/
public interface Cards{ int totalCount(int a, int b); }
20.Below code includes a valid Functional Interface ? package functionalInterfaceExample;
True
21.Stream operations in java 8 can be divided into
All
22.Terminal operation produces another stream as its output
False
23.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
24.The newly introduced Streams API is available in which package of java 8
Java.util.stream
25.Stream operation iterations are internal over the source of elements
False
26.Each pipeline ends with a
m
Terminal operation
er as
27.Which of these does Stream filter() operates on
co
Predicate
eH w
38.Which of the following is valid Stream operation type
o.
Both
rs e
39.Identify intermediate and terminal operations in the code. double average = roster
ou urc
.stream() .filter(p -> p.getGender() == Person.Sex.MALE) .mapToInt(Person::getAge) .average()
.getAsDouble();
Intermediate: filter, mapToInt Terminal: average
o
aC s
getAnnotationsByType()
41.Type annotation used to depict non blank string value
@NotBlank
ed d
False
45.In Functional Reactive Programming, we pull the stream of data
False
46.Library used to write reactive programs in java
sh
RxJava
47.Which method is used to connect the consumer to the source in reactive programming
subscribe()
48.Which class can be used Instead of System.getCurrentTimeMillis() to get a date and time in
Java 8
This study source was downloaded by 100000821315344 from CourseHero.com on 09-18-2021 16:10:15 GMT -05:00
https://www.coursehero.com/file/77195709/Java8-Innards-FrescoPlaydocx/
Clock
49.Which package contains Date/Time (JSR 310) API in Java 8
Java.time
50.Reactive Programming deals with
asynchronous data
51.DateTimeFormatter formatter=DateTimeFormatter.ofPattern("EEEE",Locale.US);
System.out.println(formatter.format(LocalDateTime.now()));
Choose the correct output.
Friday
52.import java.util.Optional;
public class App { }
Compilation error
53.Which of the following can be a valid input for jdeps dependency analyzer?
All the options mentioned
54.Example of functional interfaces in Java 8
m
Both
er as
55.Which methods preserve parameter names in Java bytecode (through reflection API)
co
specify -parameters during compilation
eH w
56.Which of the following class implements an encoder for encoding byte data using the Base64
o.
encoding scheme in Java8?
Base64.Encoder rs e
ou urc
57.In java 8, Static methods cannot be added to a Interface
False
58.We need to override which Predicate method in Java 8. Which is the right method call
o
test(T t)
aC s
Period: 1
is
Th
sh
This study source was downloaded by 100000821315344 from CourseHero.com on 09-18-2021 16:10:15 GMT -05:00
https://www.coursehero.com/file/77195709/Java8-Innards-FrescoPlaydocx/
Powered by TCPDF (www.tcpdf.org)