Question 16

Given:

and the code fragment:
S2 sobj = new S2(); sobj.display(10, 100);
What is the result?
  • Question 17

    Given the code fragment:

    What is the result?
  • Question 18

    Given the code fragments:

    Which code fragment, when inserted at line n1, enables the code to print Hank?
  • Question 19

    The following grid shows the state of a 2D array:

    This grid is created with the following code:

    Which line of code, when inserted in place of //line n1, adds an X into the grid so that the grid contains three consecutive X's?
  • Question 20

    Given the code fragment:

    And given the requirements:
    Which two code fragments can be independently placed at line n1 to meet the requirements?