Lambda Expression

Q: Which of the following is true for the arguments in a lambda expression?
A: type of the arguments can be omitted
Q: What is the return type of a lambda expression?
A: Function
Q: A Lambda expression can be used.
A: option 1 and 3
Q: What will be the output of the following code?
public class LambdaExpressionExample7
{
    public static void main(String[] args) 
    {

        List list=new ArrayList();
        list.add("ankit");
        list.add("mayank");
        list.add("irfan");
        list.add("jai");
        list.forEach(
        (n)->System.out.print(n+",")
    );
    }
}
A: will print the correct output
Q: How can we write a parameter less lambda expression?
A: Pass empty set of parentheses on the left side of the arrow
Q: A Java lambda expression consists of the following components.
A: All of the mentioned
Q: Choose the correct option based on this program.
import java.util.function.Function;
 
public class AndThen {  
    public static void main(String []args) {   
            Function negate = (i -> -i), square = (i -> i * i),                
                negateSquare = negate.compose(square);
            System.out.println(negateSquare.apply(10)); 
    }
}
A: this program prints: -100 
Q: Which of the following statements is true?
A: Curly brackets are required whenever the return keyword is used in a lambda expression
Q: Which of the following statements are true?A)Addable ad1=(a,b)->(a+b);B)Addable ad2=(int a,int b)->(a+b);C)Addable ad3=(a,b) > (a+b);D)Addable ad3= (a,b) ~ (a+b);
interface Addable
{
    int add(int a,int b);
}
A: A
Q: Choose the correct option based on this program.
import java.util.function.BiFunction;
    
public class StringCompare {    
    public static void main(String args[]){       
        BiFunction compareString = (x, y) -> x.equals(y);    
        System.out.println(compareString.apply("Java8","Java8")); // #1  
    }
}
A: this program prints: true 
Q: Which of the following are valid lambda expressions? 
A: (int i) -> i
Q: Which of the following can be used to create a lambda that accepts an integer and returns nothing?
A: Consumer
Q: How is this keyword handled inside a lambda expression?
A: this refers to the enclosing class of the lambda expression
Q: Which statement is correct in regard to the lambda expression?
A: All of the mentioned
Q: What is True about Lambda?
A: Lambda expression enable functions to be passed as argument