Weekend Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ac4s65

Given the definition of the Country class:public class country {public enum Continent {ASIA, EUROPE}String name;Continent...

Given the definition of the Country class:

public class country {

public enum Continent {ASIA, EUROPE}

String name;

Continent region;

public Country (String na, Continent reg) {

name = na, region = reg;

}

public String getName () {return name;}

public Continent getRegion () {return region;}

}

and the code fragment:

List couList = Arrays.asList (

new Country (“Japan”, Country.Continent.ASIA),

new Country (“Italy”, Country.Continent.EUROPE),

new Country (“Germany”, Country.Continent.EUROPE));

Map> regionNames = couList.stream ()

.collect(Collectors.groupingBy (Country ::getRegion,

Collectors.mapping(Country::getName, Collectors.toList()))));

System.out.println(regionNames);

What is the output?

A.

{EUROPE = [Italy, Germany], ASIA = [Japan]}

B.

{ASIA = [Japan], EUROPE = [Italy, Germany]}

C.

{EUROPE = [Germany, Italy], ASIA = [Japan]}

D.

{EUROPE = [Germany], EUROPE = [Italy], ASIA = [Japan]}

1z0-809 PDF/Engine
  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions
buy now 1z0-809 pdf
Get 65% Discount on All Products, Use Coupon: "ac4s65"