Question: Which method reference can replace the lambda in the first line of the main() method to produce the same output? A. System:out:println B. System::out:println C.

Which method reference can replace the lambda in the first line of the main() method to produce the same output? 

interface Marsupial { void carryInPouch (int size); } public class Opossum {

A. System:out:println

B. System::out:println

C. System::out::println

D. System.out::println

E. None of the above.

interface Marsupial { void carryInPouch (int size); } public class Opossum { public static void main(String[] args) { Marsupial mar = x -> System.out.println ("Carrying } } mar.carryInPouch (1); 11 + x);

Step by Step Solution

3.49 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The given code snippet in the image shows the Opossum class with a main method that creates an insta... 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 Oracle Questions!