1z0-830 Exam Question 6

Which of the following methods of java.util.function.Predicate aredefault methods?
  • 1z0-830 Exam Question 7

    Given:
    java
    String s = " ";
    System.out.print("[" + s.strip());
    s = " hello ";
    System.out.print("," + s.strip());
    s = "h i ";
    System.out.print("," + s.strip() + "]");
    What is printed?
  • 1z0-830 Exam Question 8

    Given:
    java
    public class SpecialAddition extends Addition implements Special {
    public static void main(String[] args) {
    System.out.println(new SpecialAddition().add());
    }
    int add() {
    return --foo + bar--;
    }
    }
    class Addition {
    int foo = 1;
    }
    interface Special {
    int bar = 1;
    }
    What is printed?
  • 1z0-830 Exam Question 9

    Given:
    java
    sealed class Vehicle permits Car, Bike {
    }
    non-sealed class Car extends Vehicle {
    }
    final class Bike extends Vehicle {
    }
    public class SealedClassTest {
    public static void main(String[] args) {
    Class<?> vehicleClass = Vehicle.class;
    Class<?> carClass = Car.class;
    Class<?> bikeClass = Bike.class;
    System.out.print("Is Vehicle sealed? " + vehicleClass.isSealed() +
    "; Is Car sealed? " + carClass.isSealed() +
    "; Is Bike sealed? " + bikeClass.isSealed());
    }
    }
    What is printed?
  • 1z0-830 Exam Question 10

    Given a properties file on the classpath named Person.properties with the content:
    ini
    name=James
    And:
    java
    public class Person extends ListResourceBundle {
    protected Object[][] getContents() {
    return new Object[][]{
    {"name", "Jeanne"}
    };
    }
    }
    And:
    java
    public class Test {
    public static void main(String[] args) {
    ResourceBundle bundle = ResourceBundle.getBundle("Person");
    String name = bundle.getString("name");
    System.out.println(name);
    }
    }
    What is the given program's output?