최신 Java SE 1z1-830 무료샘플문제:
1. Given:
java
var _ = 3;
var $ = 7;
System.out.println(_ + $);
What is printed?
A) It throws an exception.
B) _$
C) 10
D) Compilation fails.
2. Given:
java
public class Test {
class A {
}
static class B {
}
public static void main(String[] args) {
// Insert here
}
}
Which three of the following are valid statements when inserted into the given program?
A) B b = new B();
B) A a = new A();
C) B b = new Test.B();
D) A a = new Test.A();
E) A a = new Test().new A();
F) B b = new Test().new B();
3. Given:
java
List<String> abc = List.of("a", "b", "c");
abc.stream()
.forEach(x -> {
x = x.toUpperCase();
});
abc.stream()
.forEach(System.out::print);
What is the output?
A) ABC
B) An exception is thrown.
C) abc
D) Compilation fails.
4. Which of the following statements are correct?
A) None
B) You can use 'protected' access modifier with all kinds of classes
C) You can use 'final' modifier with all kinds of classes
D) You can use 'private' access modifier with all kinds of classes
E) You can use 'public' access modifier with all kinds of classes
5. Which three of the following are correct about the Java module system?
A) The unnamed module can only access packages defined in the unnamed module.
B) Code in an explicitly named module can access types in the unnamed module.
C) If a package is defined in both a named module and the unnamed module, then the package in the unnamed module is ignored.
D) If a request is made to load a type whose package is not defined in any known module, then the module system will attempt to load it from the classpath.
E) We must add a module descriptor to make an application developed using a Java version prior to SE9 run on Java 11.
F) The unnamed module exports all of its packages.
질문과 대답:
질문 # 1 정답: D | 질문 # 2 정답: A,C,E | 질문 # 3 정답: C | 질문 # 4 정답: A | 질문 # 5 정답: C,D,F |