This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
What Is The Purpose Of Tolongfunction<t> Functional Interface? |
|
Answer» It REPRESENTS a FUNCTION that PRODUCES a long-valued RESULT. It represents a function that produces a long-valued result. |
|
| 52. |
What Is The Purpose Of Tolongbifunction<t,u> Functional Interface? |
|
Answer» It REPRESENTS a FUNCTION that ACCEPTS TWO arguments and produces a long-valued RESULT. It represents a function that accepts two arguments and produces a long-valued result. |
|
| 53. |
What Is The Purpose Of Tointfunction<t> Functional Interface? |
|
Answer» It REPRESENTS a FUNCTION that PRODUCES an int-valued RESULT. It represents a function that produces an int-valued result. |
|
| 54. |
What Is The Purpose Of Tointbifunction<t,u> Functional Interface? |
|
Answer» It REPRESENTS a function that ACCEPTS two ARGUMENTS and PRODUCES an int-valued RESULT. It represents a function that accepts two arguments and produces an int-valued result. |
|
| 55. |
What Is The Purpose Of Todoublefunction<t> Functional Interface? |
|
Answer» It REPRESENTS a FUNCTION that PRODUCES a double-valued RESULT. It represents a function that produces a double-valued result. |
|
| 56. |
What Is The Purpose Of Todoublebifunction<t,u> Functional Interface? |
|
Answer» It REPRESENTS a function that ACCEPTS two ARGUMENTS and PRODUCES a double-valued result. It represents a function that accepts two arguments and produces a double-valued result. |
|
| 57. |
What Is The Purpose Of Supplier<t> Functional Interface? |
|
Answer» It REPRESENTS a SUPPLIER of RESULTS. It represents a supplier of results. |
|
| 58. |
What Is The Purpose Of Predicate<t> Functional Interface? |
|
Answer» It REPRESENTS a PREDICATE (Boolean-valued FUNCTION) of ONE ARGUMENT. It represents a predicate (Boolean-valued function) of one argument. |
|
| 59. |
What Is The Purpose Of Objlongconsumer<t> Functional Interface? |
|
Answer» It REPRESENTS an OPERATION that ACCEPTS an object-valued and a long-valued argument, and RETURNS no result. It represents an operation that accepts an object-valued and a long-valued argument, and returns no result. |
|
| 60. |
What Is The Purpose Of Objintconsumer<t> Functional Interface? |
|
Answer» It REPRESENTS an operation that ACCEPTS an object-valued and an int-valued argument, and RETURNS no result. It represents an operation that accepts an object-valued and an int-valued argument, and returns no result. |
|
| 61. |
What Is The Purpose Of Objdoubleconsumer<t> Functional Interface? |
|
Answer» It represents an operation that ACCEPTS an object-valued and a double-valued ARGUMENT, and returns no RESULT. It represents an operation that accepts an object-valued and a double-valued argument, and returns no result. |
|
| 62. |
What Is The Purpose Of Longunaryoperator Functional Interface? |
|
Answer» It represents an operation on a SINGLE long-valued OPERAND that PRODUCES a long-valued RESULT. It represents an operation on a single long-valued operand that produces a long-valued result. |
|
| 63. |
What Is The Purpose Of Longtointfunction Functional Interface? |
|
Answer» It represents a FUNCTION that ACCEPTS a long-valued ARGUMENT and PRODUCES an int-valued result. It represents a function that accepts a long-valued argument and produces an int-valued result. |
|
| 64. |
What Is The Purpose Of Longtodoublefunction Functional Interface? |
|
Answer» It represents a function that accepts a long-valued ARGUMENT and PRODUCES a double-valued RESULT. It represents a function that accepts a long-valued argument and produces a double-valued result. |
|
| 65. |
What Is The Purpose Of Longsupplier Functional Interface? |
|
Answer» It REPRESENTS a SUPPLIER of long-valued RESULTS. It represents a supplier of long-valued results. |
|
| 66. |
What Is The Purpose Of Longpredicate Functional Interface? |
|
Answer» It REPRESENTS a PREDICATE (Boolean-valued FUNCTION) of ONE long-valued ARGUMENT. It represents a predicate (Boolean-valued function) of one long-valued argument. |
|
| 67. |
What Is The Purpose Of Longfunction<r> Functional Interface? |
|
Answer» It represents a FUNCTION that accepts a long-valued argument and PRODUCES a RESULT. It represents a function that accepts a long-valued argument and produces a result. |
|
| 68. |
What Is The Purpose Of Longconsumer Functional Interface? |
|
Answer» It represents an OPERATION that ACCEPTS a single long-valued ARGUMENT and RETURNS no RESULT. It represents an operation that accepts a single long-valued argument and returns no result. |
|
| 69. |
What Is The Purpose Of Longbinaryoperator Functional Interface? |
|
Answer» It represents an operation UPON TWO long-valued operands and produces a long-valued RESULT. It represents an operation upon two long-valued operands and produces a long-valued result. |
|
| 70. |
What Is The Purpose Of Intunaryoperator Functional Interface? |
|
Answer» It REPRESENTS an OPERATION on a SINGLE int-valued OPERAND that produces an int-valued result. It represents an operation on a single int-valued operand that produces an int-valued result. |
|
| 71. |
What Is The Purpose Of Inttolongfunction Functional Interface? |
|
Answer» It REPRESENTS a function that ACCEPTS an int-valued ARGUMENT and produces a long-valued result. It represents a function that accepts an int-valued argument and produces a long-valued result. |
|
| 72. |
What Is The Purpose Of Inttodoublefunction Functional Interface? |
|
Answer» It REPRESENTS a FUNCTION that ACCEPTS an int-valued argument and PRODUCES a double-valued result. It represents a function that accepts an int-valued argument and produces a double-valued result. |
|
| 73. |
What Is The Purpose Of Intsupplier Functional Interface? |
|
Answer» It REPRESENTS a SUPPLIER of int-valued RESULTS. It represents a supplier of int-valued results. |
|
| 74. |
What Is The Purpose Of Intpredicate Functional Interface? |
|
Answer» It REPRESENTS a PREDICATE (Boolean-valued FUNCTION) of ONE int-valued ARGUMENT. It represents a predicate (Boolean-valued function) of one int-valued argument. |
|
| 75. |
What Is The Purpose Of Intfunction<r> Functional Interface? |
|
Answer» It represents a FUNCTION that ACCEPTS an int-valued ARGUMENT and produces a RESULT. It represents a function that accepts an int-valued argument and produces a result. |
|
| 76. |
What Is The Purpose Of Intconsumer Functional Interface? |
|
Answer» It REPRESENTS an OPERATION that accepts a SINGLE int-valued argument and returns no RESULT. It represents an operation that accepts a single int-valued argument and returns no result. |
|
| 77. |
What Is The Purpose Of Intbinaryoperator Functional Interface? |
|
Answer» It REPRESENTS an operation UPON two int-valued OPERANDS and PRODUCES an int-valued result. It represents an operation upon two int-valued operands and produces an int-valued result. |
|
| 78. |
What Is The Purpose Of Function<t,r> Functional Interface? |
|
Answer» It REPRESENTS a function that accepts one argument and PRODUCES a RESULT. It represents a function that accepts one argument and produces a result. |
|
| 79. |
What Is The Purpose Of Doubleunaryoperator Functional Interface? |
|
Answer» It represents an operation on a SINGLE double-valued operand that produces a double-valued RESULT. It represents an operation on a single double-valued operand that produces a double-valued result. |
|
| 80. |
What Is The Purpose Of Doubletolongfunction Functional Interface? |
|
Answer» It represents a function that ACCEPTS a double-valued ARGUMENT and produces a long-valued RESULT. It represents a function that accepts a double-valued argument and produces a long-valued result. |
|
| 81. |
What Is The Purpose Of Doubletointfunction Functional Interface? |
|
Answer» It REPRESENTS a function that accepts a double-valued ARGUMENT and produces an int-valued RESULT. It represents a function that accepts a double-valued argument and produces an int-valued result. |
|
| 82. |
What Is The Purpose Of Doublesupplier Functional Interface? |
|
Answer» It REPRESENTS a SUPPLIER of double-valued RESULTS. It represents a supplier of double-valued results. |
|
| 83. |
What Is The Purpose Of Doublepredicate Functional Interface? |
|
Answer» It REPRESENTS a PREDICATE (Boolean-valued FUNCTION) of ONE double-valued ARGUMENT. It represents a predicate (Boolean-valued function) of one double-valued argument. |
|
| 84. |
What Is The Purpose Of Doublefunction<r> Functional Interface? |
|
Answer» It REPRESENTS a FUNCTION that accepts a double-valued ARGUMENT and PRODUCES a result. It represents a function that accepts a double-valued argument and produces a result. |
|
| 85. |
What Is The Purpose Of Doubleconsumer Functional Interface? |
|
Answer» It represents an operation that accepts a SINGLE double-valued ARGUMENT and RETURNS no RESULT. It represents an operation that accepts a single double-valued argument and returns no result. |
|
| 86. |
What Is The Purpose Of Doublebinaryoperator Functional Interface? |
|
Answer» It represents an OPERATION upon two double-valued OPERANDS and PRODUCING a double-valued RESULT. It represents an operation upon two double-valued operands and producing a double-valued result. |
|
| 87. |
What Is The Purpose Of Consumer<t> Functional Interface? |
|
Answer» It represents an OPERATION that accepts a single input argument and RETURNS no RESULT. It represents an operation that accepts a single input argument and returns no result. |
|
| 88. |
What Is The Purpose Of Booleansupplier Functional Interface? |
|
Answer» It REPRESENTS a SUPPLIER of Boolean-valued RESULTS. It represents a supplier of Boolean-valued results. |
|
| 89. |
What Is The Purpose Of Bipredicate<t,u> Functional Interface? |
|
Answer» It REPRESENTS a PREDICATE (Boolean-valued FUNCTION) of TWO ARGUMENTS. It represents a predicate (Boolean-valued function) of two arguments. |
|
| 90. |
What Is The Purpose Of Binaryoperator<t> Functional Interface? |
|
Answer» It REPRESENTS an operation UPON TWO OPERANDS of the same type, producing a RESULT of the same type as the operands. It represents an operation upon two operands of the same type, producing a result of the same type as the operands. |
|
| 91. |
What Is The Purpose Of Bifunction<t,u,r> Functional Interface? |
|
Answer» It represents a function that ACCEPTS TWO ARGUMENTS and PRODUCES a RESULT. It represents a function that accepts two arguments and produces a result. |
|
| 92. |
What Is The Purpose Of Biconsumer<t,u> Functional Interface? |
|
Answer» It REPRESENTS an operation that ACCEPTS two input ARGUMENTS, and returns no RESULT. It represents an operation that accepts two input arguments, and returns no result. |
|
| 93. |
What Are Functional Interfaces? |
|
Answer» FUNCTIONAL INTERFACES have a single functionality to exhibit. For example, a Comparable INTERFACE with a single method 'compareTo' is used for comparison purpose. Java 8 has DEFINED a lot of functional interfaces to be used extensively in lambda expressions. Functional interfaces have a single functionality to exhibit. For example, a Comparable interface with a single method 'compareTo' is used for comparison purpose. Java 8 has defined a lot of functional interfaces to be used extensively in lambda expressions. |
|
| 94. |
Explain The System.out::println Expression? |
|
Answer» SYSTEM.out::println METHOD is a STATIC method reference to println method of out OBJECT of System CLASS. System.out::println method is a static method reference to println method of out object of System class. |
|
| 95. |
What Are Method References? |
|
Answer» Method references HELP to point to methods by their names. A method reference is DESCRIBED using :: (double colon) SYMBOL. A method reference can be used to point the following types of methods − Method references help to point to methods by their names. A method reference is described using :: (double colon) symbol. A method reference can be used to point the following types of methods − |
|
| 96. |
What Kind Of Variable You Can Access In An Lambda Expression? |
|
Answer» Using lambda expression, you can refer to final variable or effectively final variable (which is ASSIGNED only once). Lambda expression throws a COMPILATION error, if a variable is assigned a VALUE the second TIME. Using lambda expression, you can refer to final variable or effectively final variable (which is assigned only once). Lambda expression throws a compilation error, if a variable is assigned a value the second time. |
|
| 97. |
Why Lambda Expression Is To Be Used? |
|
Answer» Lambda EXPRESSIONS are used primarily to define inline implementation of a functional interface, i.e., an interface with a single method only. In the above example, we've used VARIOUS types of lambda expressions to define the operation method of MathOperation interface. Then we have DEFINED the implementation of sayMessage of GreetingService. Lambda expression eliminates the need of anonymous class and gives a very SIMPLE yet powerful functional programming capability to Java. Lambda expressions are used primarily to define inline implementation of a functional interface, i.e., an interface with a single method only. In the above example, we've used various types of lambda expressions to define the operation method of MathOperation interface. Then we have defined the implementation of sayMessage of GreetingService. Lambda expression eliminates the need of anonymous class and gives a very simple yet powerful functional programming capability to Java. |
|
| 98. |
What Are The Characteristics Of A Java 8 Lambda Expression? |
|
Answer» A lambda expression is characterized by the following syntax - PARAMETER −> expression body Following are the important characteristics of a lambda expression −
A lambda expression is characterized by the following syntax - parameter −> expression body Following are the important characteristics of a lambda expression − |
|
| 99. |
How Will You Sort A List Of String Using Java 8 Lambda Expression? |
|
Answer» FOLLOWING code sorts a list of string USING Java 8 lambda expression: //sort using java 8 Following code sorts a list of string using Java 8 lambda expression: //sort using java 8 |
|
| 100. |
What Are The New Features Introduced In Java 8? |
|
Answer» There are dozens of features added to JAVA 8, the most SIGNIFICANT ones are mentioned below −
Along with these new featuers, lots of FEATURE enhancements are done under-the-hood, at both compiler and JVM level. There are dozens of features added to Java 8, the most significant ones are mentioned below − Along with these new featuers, lots of feature enhancements are done under-the-hood, at both compiler and JVM level. |
|