Question: Which statements are true about the following code? Select the two correct answers. (a) (1) will not compile. (b) (2) will not compile. (c) (3)

Which statements are true about the following code?

}; }; }; }; }; import java.util.function. Predicate; public class RQ12A98 (

Select the two correct answers.

(a) (1) will not compile.

(b) (2) will not compile.

(c) (3) will not compile.

(d) (4) will not compile.

(e) (5) will not compile.

(f) (6) will not compile.

}; }; }; }; }; import java.util.function. Predicate; public class RQ12A98 ( public static final String lockl= "Brinks"; private static String lock2 = "Yale"; public static void main(String[] args) { Predicate p; p = lock -> { boolean p = lock.equals("Master"); return p; // (1) p=lock -> { return lock.toString ().equals("YALE"); // (2) p = lock -> { (args.length> 0) ? lock.equals (args [0]): false; // (3) p = lock -> { return lock.equals (lockl); // (4) p = lock -> { return lock .equals (lock2); // (5) p = lock2 -> { return lock2.equals (RQ12A98.lock2) ; // (6)

Step by Step Solution

3.59 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a and c 1 redeclares the local variable p from the enclosing scop... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!