Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

Oracle Java SE 8 Programmer II (1z0-809 Korean Version) (1z0-809 Korean) Free Practice Test

Question 1
주어진:
인터페이스 실행 가능 {
공개 무효 doSomething(문자열 s);
}
어떤 두 클래스 정의가 컴파일됩니까? (2개를 선택하세요.)

Correct Answer: A,B
Question 2
주어진 코드 조각:

n1행에 삽입할 때 코드가 /First.txt를 인쇄할 수 있도록 하는 코드 조각은 무엇입니까?

Correct Answer: A
Question 3
주어진:
1. abstract class Shape {
2. Shape ( ) { System.out.println ("Shape"); }
3. protected void area ( ) { System.out.println ("Shape"); }
4. }
5.
6. class Square extends Shape {
7. int side;
8. Square int side {
9./* insert code here */
10. this.side = side;
11. }
12. public void area ( ) { System.out.println ("Square"); }
13. }
14. class Rectangle extends Square {
15. int len, br;
16. Rectangle (int x, int y) {
17. /* insert code here */
18. len = x, br = y;
19. }
20. void area ( ) { System.out.println ("Rectangle"); }
21. }
코드를 컴파일할 수 있는 두 가지 수정 사항은 무엇입니까? (2개를 선택하세요.)

Correct Answer: D,E
Question 4
주어진 코드 조각:
인터페이스 CourseFilter 확장 Predicate<String> {
public default boolean test (String str) {
return str.contains ("Java");
}
}
and
List<String> strs = Arrays.asList("Java", "Java EE", "Embedded Java");
Predicate<String> cf1 = s - > s.length() > 3;
Predicate cf2 = new CourseFilter() { //line n1
public boolean test (String s) {
return s.startsWith ("Java");
}
};
long c = strs.stream()
.filter(cf1)
.filter(cf2//line n2
.count();
System.out.println(c);
결과는 무엇입니까?

Correct Answer: C
Question 5
주어진:
public class Product {
int id; int price;
public Product (int id, int price) {
this.id = id;
this.price = price;
}
Public String toString () { return id + ":" + price;)
}
및 코드 조각:
List<Product> products = new ArrayList <> (Arrays.asList(new Product(1, 10), new Product (2, 30), new Product (3, 20)); Product p = products.stream().reduce(new Product (4, 0), (p1, p2) -> { p1.price+=p2.price; return new Product (p1.id, p1.price);}); products.add(p); products.stream().parallel()
.reduce((p1, p2) - > p1.price > p2.price ? p1 : p2)
.ifPresent(System.out: :println);
결과는 무엇입니까?

Correct Answer: D
Question 6
주어진 코드 조각:

결과는 무엇입니까?

Correct Answer: E
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 7
다음 코드 조각을 참고하세요.

ProductCode 클래스를 정의해 달라는 요청을 받았습니다. ProductCode 클래스 정의는 c1 인스턴스 생성이 성공하도록 허용해야 하며, c2 인스턴스 생성 시에는 컴파일 오류가 발생해야 합니다.
ProductCode의 어떤 정의가 요구 사항을 충족합니까?

Correct Answer: B
Question 8
주어진:

및 코드 조각:

스레드 t1 및 t2는 비동기적으로 실행되며 ABCA 또는 AACB를 인쇄할 수 있습니다.
스레드가 동기적으로 실행되고 ABC를 인쇄하도록 코드를 수정하라는 요청을 받았습니다.
어떤 수정이 요구 사항을 충족합니까?

Correct Answer: A
Question 9
주어진 코드 조각:
List<String> nL = Arrays.asList("Jim", "John", "Jeff");
Function<String, String> funVal = s -> "Hello : ".concat(s);
nL.Stream()
.map(funVal)
.forEach(s-> System.out.print (s));
결과는 무엇입니까?

Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 10
Employee 테이블의 레코드가 주어지면:

코드 조각이 주어지면 :
try {
Connection conn = DriverManager.getConnection (URL, userName, passWord); Statement st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); st.execute("SELECT*FROM Employee"); ResultSet rs = st.getResultSet(); while (rs.next()) { if (rs.getInt(1) ==112) { rs.updateString(2, "Jack");
}
}
rs.absolute(2);
System.out.println(rs.getInt(1) + " " + rs.getString(2));
} catch (SQLException ex) {
System.out.println("Exception is raised");
}
다음과 같이 가정합니다.
필수 데이터베이스 드라이버는 클래스 경로에 구성됩니다.
URL, userName 및 passWord로 액세스할 수 있는 적절한 데이터베이스가 있습니다.
결과는 무엇입니까?

Correct Answer: B
Question 11
주어진 코드 조각:
UnaryOperator<Double> uo1 = s -> s*2;//라인 n1
List<Double> loanValues ​​= Arrays.asList(1000.0, 2000.0);
대출값.stream()
.filter(lv -> lv >= 1500)
.map(lv -> uo1.apply(lv))//line n2
.forEach(s -> System.out.print(s + " "));
결과는 무엇입니까?

Correct Answer: D
Question 12
Player 테이블에서 주어진 레코드:

코드 조각이 주어지면 :
노력하다 {
연결 conn = DriverManager.getConnection(URL, 사용자 이름, 암호); 문 st= conn.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); st.execute("플레이어에서 * 선택"); st.setMaxRows(2); 결과 집합 rs = st.getResultSet(); rs.absolute(3); 동안 (rs.next()) { System.out.println(rs.getInt(1) + " " + rs.getString(2));
}
} catch(SQLException 예) {
System.out.print("SQLException이 발생했습니다.");
}
다음과 같이 가정합니다.
필수 데이터베이스 드라이버는 클래스 경로에 구성됩니다.
URL, 사용자 이름 및 암호를 사용하여 해당 데이터베이스에 액세스할 수 있습니다.
SQL 쿼리가 유효합니다.
결과는 무엇입니까?

Correct Answer: B
Question 13
속성 파일을 사용하여 애플리케이션을 현지화하는 ResourceBundle을 생성하라는 요청을 받았습니다.
파일 메뉴 및 보기 메뉴 값으로 menu1 및 menu2의 유효한 키를 지정하는 코드 예제는 무엇입니까?

Correct Answer: B
Question 14
주어진 코드 조각:
Stream<List<String>> iStr= Stream.of (
Arrays.asList ("1", "John"),
Arrays.asList ("2", null)0;
Stream<<String> nInSt = iStr.flatMapToInt ((x) -> x.stream ());
nInSt.forEach (System.out :: print);
결과는 무엇입니까?

Correct Answer: C
Question 15
주어진:

결과는 무엇입니까?

Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).