Sail E0 Webinar

MCQs

Total Questions : 25 | Page 2 of 3 pages
Question 11. Which of the following functional interface represents a function that accepts a double-valued argument and produces a long-valued result?
  1.    DoubleToLongFunction
  2.    DoubleUnaryOperator
  3.    Function
  4.    IntBinaryOperator
 Discuss Question
Answer: Option A. -> DoubleToLongFunction




Question 12. Nashorn the new JavaScript engine is an implementation of
  1.    javax.engine.Engine
  2.    javax.script.Engine
  3.    javax.javaScript.Engine
  4.    javax.script.ScriptEngine
 Discuss Question
Answer: Option D. -> javax.script.ScriptEngine




Question 13. Code for Java 8 essentially used to be
  1.    Declarative
  2.    Imperative
  3.    Subjective
  4.    None
 Discuss Question
Answer: Option B. -> Imperative




Question 14. What does SAM stand for in context of Functional Interface?
  1.    Single Ambivalue Method
  2.    Single Abstract Method
  3.    Simple Active Markup
  4.    Simple Abstract Markup
 Discuss Question
Answer: Option B. -> Single Abstract Method




Question 15. A pipeline is a sequence of what operations in java 8
  1.    multi-threading
  2.    concurrent
  3.    consequent
  4.    stream
 Discuss Question
Answer: Option D. -> stream




Question 16. The newly introduced Streams API is available in which package of java 8:
  1.    java.io.streams
  2.    java.io.stream
  3.    java.util.streams
  4.    java.util.stream
 Discuss Question
Answer: Option D. -> java.util.stream




Question 17. Which of the following gets introduced with Java 8?
  1.    Lambda expression
  2.    Compact profiles
  3.    Stream API
  4.    Only first two
 Discuss Question
Answer: Option A. -> Lambda expression




Question 18. What is the Optional object used for?
  1.    Optional is used for optional runtime argument
  2.    Optional is used for optional spring profile
  3.    Optional is used to represent null with absent value
  4.    Optional means its not mandatory for method to return object
 Discuss Question
Answer: Option C. -> Optional is used to represent null with absent value




Question 19. A method within a class is only accessible by classes that are defined within the same package as the class of the method. Which one of the following is used to
enforce such restriction?
  1.    Declare the method with the keyword public
  2.    Declare the method with the keyword private
  3.    Declare the method with the keyword protected
  4.    Do not declare the method with any accessibility modifiers
 Discuss Question
Answer: Option D. -> Do not declare the method with any accessibility modifiers




Question 20. In Java 8 Interfaces, methods can be:
  1.    default
  2.    abstract
  3.    all
  4.    None
 Discuss Question
Answer: Option C. -> all




Latest Videos

Latest Test Papers