Question: Which lines fail to compile? A. Only line x B. Only line y C. Both lines x and y D. The code compiles. package armory;
Which lines fail to compile?

A. Only line x
B. Only line y
C. Both lines x and y
D. The code compiles.
package armory; import java.util.function. *; interface Shield { void protect(); } class Dragon { int addDragon (Integer count) { return ++count; } } public class Sword { public static void main(String[] knight) { var dragon = new Dragon (); Function func = Shield::protect; // line x UnaryOperator op = dragon:: addDragon; // line y } }
Step by Step Solution
3.36 Rating (162 Votes )
There are 3 Steps involved in it
To analyze the code provided in the image and determine which line fails to compile we should consid... View full answer
Get step-by-step solutions from verified subject matter experts
