XJava
XJava
DateTimeFormatter dateFormat=DateTimeFormatter.ISO_DATE;
LocalDate dateOfBirth= LocalDate.of(2015,Month.FEBRUARY,31);
System.out.println(dateFormat.format(dateOfBirth)); - Java date time exception
ZoneId zoneId=ZoneId.of("Asia/Singapore");
ZonedDateTime.of(LocalDateTime.now(),zoneId);
System.out.println(ZonedDateTime.getOffset());
Assume that the offset value for Asia/Singapore time zone from UTC/Greenwich is
+08:00. Choose the correct option.-Prints +08:00
import java.time.Clock;
public class App{
public static void main(String [] args){
final Clock clock=Clock.systemUTC();
System.out.println(clock.instant());
System.out.println(clock.millis());
}
} - compilation error
Which of the following is the correct lambda expression which add two numbers and
return their sum?-(a, b) -> a + b
Which method is used to connect the consumer to the source in reactive programming-
subscribe()
DateTimeFormatter formatter=DateTimeFormatter.ofPattern("EEEE",Locale.US);
System.out.println(formatter.format(LocalDateTime.now())); - Friday
Which of the following can be a valid input for jdeps dependency analyzer-all
'map' and 'filter' are-intermediate
Method used to fetch the parameter types using method parameter reflection-
getParameterizedType()
In java 8, Static methods cannot be added to a Interface-False
In Functional Reactive Programming, we pull the stream of data-false
Which methods preserve parameter names in Java bytecode (through reflection API)-
specify -parameters during compilation
Which is new command line tool for the Nashorn JavaScript engine in java 8-jjs