Question 101

Given the following array:

Which two code fragments, independently, print each element in this array?
  • Question 102

    Which statement is true about java byte code?
  • Question 103

    Given:
    final class Folder {//line n1 //line n2 public void open () { System.out.print("Open"); } } public class Test { public static void main (String [] args) throws Exception { try (Folder f = new Folder()) { f.open(); } } } Which two modifications enable the code to print Open Close?
  • Question 104

    Given:
    public class Test<T> {
    private T t;
    public T get () {
    return t;
    }
    public void set (T t) {
    this.t = t;
    }
    public static void main (String args [ ] ) {
    Test<String> type = new Test<>();
    Test type 1 = new Test ();//line n1
    type.set("Java");
    type1.set(100);//line n2
    System.out.print(type.get() + " " + type1.get());
    }
    }
    What is the result?
  • Question 105

    Given the code fragment:

    What is the result?
    Word: why what when