What is the result?
What is the result?
The code defines a BiPredicate and a BiFunction. The BiPredicate checks if the first string contains 'SG' and the second string contains 'Java'. The BiFunction applies this predicate and sets the fee to 100 if the condition is met. In this case, both conditions are true for the provided inputs 'D101SG' and 'Java Programming', so the fee is set to 100 and returned. Therefore, the output is 100.
Answer is B==> 100 , tested BiPredicate<String, String> bp=(String s1,String s2)->s1.contains("SG")&& s2.contains("Java"); BiFunction<String, String, Integer>bf=(String s1,String s2)->{ int fee=0; if(bp.test(s1,s2)) { fee=100; } return fee; }; int fee1=bf.apply("D101SG", "Java programming"); System.out.println(fee1);
B,tested
Answer is B==> 100 , tested
B is answer, tested.
B is correct, tested 22/09/2023
feel = 100; B