Question 91

Given that data.txt and alldata.txt are accessible, and the code fragment:

What is required at line n1 to enable the code to overwrite alldata.txt with data.txt?
  • Question 92

    Given the code fragment:

    What is the result?
  • Question 93

    Given the code fragment:
    UnaryOperator<Integer> uo1 = s -> s*2; line n1
    List<Double> loanValues = Arrays.asList(1000.0, 2000.0);
    loanValues.stream()
    . filter(lv -> lv >= 1500)
    . map(lv -> uo1.apply(lv))
    . forEach(s -> System.out.print(s + " "));
    What is the result?
  • Question 94

    Given:
    public class Canvas implements Drawable {
    public void draw () { }
    }
    public abstract class Board extends Canvas { }
    public class Paper extends Canvas {
    protected void draw (int color) { }
    }
    public class Frame extends Canvas implements Drawable {
    public void resize () { }
    }
    public interface Drawable {
    public abstract void draw ();
    }
    Which statement is true?
  • Question 95

    Which statement best describes encapsulation?