Question 66

Given:

What is the result?
  • Question 67

    Which statement is true about the DriverManager class?
  • Question 68

    Given:
    class Vehicle {
    int vno;
    String name;
    public Vehicle (int vno, String name) {
    this.vno = vno,;
    this.name = name;
    }
    public String toString () {
    return vno + ":" + name;
    }
    }
    and this code fragment:
    Set<Vehicle> vehicles = new TreeSet <> ();
    vehicles.add(new Vehicle (10123, "Ford"));
    vehicles.add(new Vehicle (10124, "BMW"));
    System.out.println(vehicles);
    What is the result?
  • Question 69

    Given the code fragment:
    List<String> nL = Arrays.asList("Jim", "John", "Jeff");
    Function<String, String> funVal = s -> "Hello : ".contact(s);
    nL.Stream()
    .map(funVal)
    .peek(System.out::print);
    What is the result?
    Hello : Jim Hello : John Hello : Jeff
  • Question 70

    Given the code fragments:
    class MyThread implements Runnable {
    private static AtomicInteger count = new AtomicInteger (0);
    public void run () {
    int x = count.incrementAndGet();
    System.out.print (x+" ");
    }
    }
    and
    Thread thread1 = new Thread(new MyThread());
    Thread thread2 = new Thread(new MyThread());
    Thread thread3 = new Thread(new MyThread());
    Thread [] ta = {thread1, thread2, thread3};
    for (int x= 0; x < 3; x++) {
    ta[x].start();
    }
    Which statement is true?