QUESTION 61
Given:
public interface Moveable<Integer> {
public default void walk (Integer distance) {System.out.println
("Walking");}
public void run(Integer distance);
}
Which statement is true?
A.
Moveable
can be used as below:
Moveable<Integer> animal = n - > System.out.println(“Running” + n);
animal.run(100);
animal.walk(20);
B.
Moveable
can be used as below:
Moveable<Integer> animal = n - > n + 10;
animal.run(100);
animal.walk(20);
C.
Moveable
can be used as below:
Moveable animal = (Integer n) - > System.out.println(n);
animal.run(100);
Moveable.walk(20);
D.
Movable
cannot be used in a lambda expression.
Correct Answer:
A
Section: (none)
Explanation
![](https://img-blog.csdnimg.cn/20200316001741972.png)
![](https://img-blog.csdnimg.cn/20200316001755282.png)
![](https://img-blog.csdnimg.cn/20200316001805715.png)
Explanation/Reference:
QUESTION 62
Which two code blocks correctly initialize a Locale variable? (Choose two.)
A.
Locale loc1 = "UK";
B.
Locale loc2 = Locale.getInstance("ru");
C.
Locale loc3 = Locale.getLocaleFactory("RU");
D.
Locale loc4 = Locale.UK;
E.
Locale loc5 = new Locale ("ru", "RU");
Correct Answer:
DE
Section: (none)
Explanation
Explanation/Reference:
QUESTION 63
Given:
class FuelNotAvailException extends Exception { }
class Vehicle {
void ride() throws FuelNotAvailException { //line n1
System.out.println(“Happy Jour