Free 1z0-830 Exam Dumps

Question 6

Given: java
package vehicule.parent;
public class Car {
protected String brand = "Peugeot";
}
and java
package vehicule.child; import vehicule.parent.Car;
public class MiniVan extends Car { public static void main(String[] args) { Car car = new Car();
car.brand = "Peugeot 807"; System.out.println(car.brand);
}
}
What is printed?

Correct Answer:D

Question 7

Which of the following statements is correct about a final class?

Correct Answer:C

Question 8

Given: java
Runnable task1 = () -> System.out.println("Executing Task-1"); Callable task2 = () -> {
System.out.println("Executing Task-2"); return "Task-2 Finish.";
};
ExecutorService execService = Executors.newCachedThreadPool();
// INSERT CODE HERE
execService.awaitTermination(3, TimeUnit.SECONDS); execService.shutdownNow();
Which of the following statements, inserted in the code above, printsboth:
"Executing Task-2" and "Executing Task-1"?

Correct Answer:GH

Question 9

Given: java
double amount = 42_000.00;
NumberFormat format = NumberFormat.getCompactNumberInstance(Locale.FRANCE, NumberFormat.Style.SHORT);
System.out.println(format.format(amount)); What is the output?

Correct Answer:D

Question 10

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?

Correct Answer:C