Untitled
Untitled
1517563753614
41) Which of the following can be a valid input for jdeps dependency analyzer?
All the options mentioned
42) Example of functional interfaces in Java 8
Both
43) Which of the following is the correct lambda expression which add two numbers
and return their sum?
Both
44) LocalDate date1 = LocalDate.now();
LocalDate date2 = date1.plus(1, ChronoUnit.MONTHS);
Period period = Period.between(date2, date1);
System.out.println("Period: " + period);
Choose the correct output.
Period: P-1M
45) Lambda Expressions in Java allow us to treat
Code as data
46) import java.util.Optional;
public class App {
public static void main(String[] args) {
String[] str = new String[10];
str[5] = null;;
str[4] = "JAVA OPTIONAL CLASS EXAMPLE";
Optional<String> checkNull = Optional.ofNullable(str[5]);
if(checkNull.isPresent()){ // It Checks, value is present or not
String lowercaseString = str[5].toLowerCase();
System.out.print(lowercaseString);
}else
System.out.println("String value is not present");
}
}
Choose the correct output.
String value is not present
*false 47) Object o = () -> {System.out.println(�Example�); }; Object o can be
replaced with ?
All the options mentioned