Question: What is true about the following code? (Choose two.) A. The code compiles successfully. B. One line does not compile. C. Two lines do not
What is true about the following code? (Choose two.)
![27: public static void main(String[] s) { Predicate dash= c -> c.startsWith("-");](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1707/3/1/1/22165c38075156ce1707311220295.jpg)
A. The code compiles successfully.
B. One line does not compile.
C. Two lines do not compile.
D. Three lines do not compile.
E. If any lines that do not compile are fixed, the output includes pink.
F. If any lines that do not compile are fixed, the output does not include pink.
27: public static void main(String[] s) { Predicate dash= c -> c.startsWith("-"); System.out.println(dash.test("")); 28: 29: 30: 31: 32: 33: 34: 35: 36: } Consumer clear = x -> System.out.println(x); clear.accept("pink"); Comparator c = (String s, String t) -> 0; System.out.println(c.compare ("s", "t"));
Step by Step Solution
3.37 Rating (141 Votes )
There are 3 Steps involved in it
In the provided code snippet a few functional interfaces of Java 8 are being used such as Predicate ... View full answer
Get step-by-step solutions from verified subject matter experts
