1z0-809 試験問題 176

Countryクラスの定義を考えると:
パブリッククラスの国{
パブリック列挙型大陸{アジア、ヨーロッパ}
文字列名;
大陸地域;
public Country(String na、Continent reg){
名前=na、地域= reg;
}
public String getName(){名前を返す;}
public Continent getRegion(){return region;}
}
およびコードフラグメント:
List<国>couList= Arrays.asList(
新しい国(「日本」、Country.Continent.ASIA)、
新しい国(「イタリア」、Country.Continent.EUROPE)、
新しい国( "ドイツ"、Country.Continent.EUROPE));
Map <Country.Continent、List <String >> regionNames = couList.stream()
.collect(Collectors.groupingBy(国:: getRegion、
Collectors.mapping(Country :: getName、Collectors.toList()))));
System.out.println(regionNames);
  • 1z0-809 試験問題 177

    コードフラグメントが与えられた場合:

    結果はどうなりますか?
  • 1z0-809 試験問題 178

    与えられた:

    およびコードフラグメント:

    結果はどうなりますか?
  • 1z0-809 試験問題 179

    与えられた:
    Book.java:
    パブリッククラスブック{
    private String read(String bname){return "Read" + bname}
    }
    EBook.java:
    パブリッククラスEBookはBookを拡張します{
    public class String read(String url){return "View" + url}
    }
    Test.java:
    パブリッククラステスト{
    public static void main(String [] args){
    ブックb1=new Book();
    b1.read( "Javaプログラミング");
    ブックb2=new EBook();
    b2.read( "http://ebook.com/ebook");
    }
    }
    結果はどうなりますか?
    Javaプログラミングを読む
  • 1z0-809 試験問題 180

    与えられた:
    IntStreamストリーム=IntStream.of(1,2,3);
    IntFunction <Integer> inFu = x-> y-> x * y; //行n1
    IntStream newStream = stream.map(inFu.apply(10)); //行n2
    newStream.forEach(System.output :: print);
    コードフラグメントをコンパイルできるようにする変更はどれですか?