Question 16

Given:

What is the result?
  • Question 17

    Given:

    Which option fails?
  • Question 18

    Given:
    class Bird {
    public void fly () { System.out.print("Can fly"); }
    }
    class Penguin extends Bird {
    public void fly () { System.out.print("Cannot fly"); }
    }
    and the code fragment:
    class Birdie {
    public static void main (String [ ] args) {
    fly( ( ) -> new Bird ( ));
    fly (Penguin : : new);
    }
    /* line n1 */
    }
    Which code fragment, when inserted at line n1, enables the Birdie class to compile?
  • Question 19

    Given:

    Which option fails?
  • Question 20

    Given that version.txt is accessible and contains:
    1234567890
    and given the code fragment:

    What is the result?