Question 71

Given the content:

and given the code fragment:

Which two code fragments, when inserted at line 1independently, enable the code to print
"Wie geht's?"
  • Question 72

    Given the definition of the Vehicle class:
    Class Vehhicle {
    int distance; //line n1
    Vehicle (int x) {
    this distance = x;
    }
    public void increSpeed(int time) { //line n2
    int timeTravel = time; //line n3
    class Car {
    int value = 0;
    public void speed () {
    value = distance /timeTravel;
    System.out.println ("Velocity with new speed"+value+"kmph");
    }
    }
    new Car().speed();
    }
    }
    and this code fragment:
    Vehicle v = new Vehicle (100);
    v.increSpeed(60);
    What is the result?
  • Question 73

    Given:

    What is the result?
  • Question 74

    Which statement is true about the DriverManagerclass?
  • Question 75

    Given the definition of the Emp class:
    public class Emp
    private String eName;
    private Integer eAge;
    Emp(String eN, Integer eA) {
    this.eName = eN;
    this.eAge = eA;
    }
    public Integer getEAge () {return eAge;}
    public String getEName () {return eName;}
    }
    and code fragment:
    List<Emp>li = Arrays.asList(new Emp("Sam", 20), New Emp("John", 60), New Emp("Jim", 51));
    Predicate<Emp> agVal = s -> s.getEAge() > 50;//line n1
    li = li.stream().filter(agVal).collect(Collectors.toList());
    Stream<String> names = li.stream()map.(Emp::getEName);//line n2
    names.forEach(n -> System.out.print(n + " "));
    What is the result?