1z0-809 試験問題 56

Given the code format:

Which code fragment must be inserted at line 6 to enable the code to compile?
  • 1z0-809 試験問題 57

    与えられた条件:
    クラス車両 {
    int 1;
    文字列名;
    パブリック車両 (int vno, 文字列名) {
    this.vno = vno,;
    this.name = 名前;
    }
    パブリック文字列toString(){
    vno + ":" + 名前を返します。
    }
    }
    そしてこのコードフラグメント:
    Set<Vehicle> 車両 = 新しい TreeSet <> ();
    車両.add(新しい車両(10123, "フォード"));
    車両.add(新しい車両(10124, "BMW"));
    System.out.println(車両);
    結果はどうなりましたか?
  • 1z0-809 試験問題 58

    次のコードフラグメントが与えられます:
    クラス Employee {
    オプション<アドレス> アドレス;
    従業員(オプション<住所>住所){
    this.address = アドレス;
    }
    public Optional<Address> getAddress() { 戻りアドレス; }
    }
    クラスアドレス{
    文字列 city = “ニューヨーク”;
    パブリック文字列 getCity { 戻り値 city: }
    パブリック文字列toString() {
    戻り都市;
    }
    }
    そして
    アドレス address = null;
    Optional<アドレス> addrs1 = Optional.ofNullable (アドレス);
    従業員 e1 = 新しい従業員 (addrs1);
    String eAddress = (addrs1.isPresent()) ? addrs1.get().getCity() : “City Not available”; 結果は何でしょうか?
  • 1z0-809 試験問題 59

    Given:

    What is the result?
  • 1z0-809 試験問題 60

    与えられた条件:
    パブリック列挙型 USCurrency {
    ペニー(1)
    ニッケル(5)
    ダイム(10)
    四半期(25);
    プライベート int 値;
    パブリックUSCurrency(int値) {
    this.value = 値;
    }
    public int getValue() {戻り値;}
    }
    パブリッククラスCoin {
    パブリック静的voidメイン(文字列[]引数){
    US通貨 usCoin =新しいUS通貨.DIME;
    System.out.println(usCoin.getValue()):
    }
    }
    指定されたコードをコンパイルできるようにするには、どの 2 つの変更を加えればよいでしょうか。