Oracle Java SE 8 Programmer II (1z0-809 Korean Version) - 1z0-809 Korean Exam Practice Test
주어진:
클래스 ImageScanner는 AutoCloseable을 구현합니다. {
public void close()는 예외를 던집니다. {
System.out.print("스캐너가 닫혔습니다.");
}
public void scanImage()는 예외를 던집니다. {
System.out.print("스캔.");
throw new Exception("검색할 수 없습니다.");
}
}
클래스 ImagePrinter는 AutoCloseable을 구현합니다. {
public void close()는 예외를 던집니다. {
System.out.print("프린터가 닫혔습니다.");
}
공개 무효 printImage() {System.out.print("인쇄."); }
}
이 코드 조각:
시도(ImageScanner ir = new ImageScanner();
ImagePrinter iw = 새로운 ImagePrinter()) {
ir.scanImage();
iw.printImage();
} catch (Exception e) {
System.out.print(e.getMessage());
}
결과는 무엇입니까?
클래스 ImageScanner는 AutoCloseable을 구현합니다. {
public void close()는 예외를 던집니다. {
System.out.print("스캐너가 닫혔습니다.");
}
public void scanImage()는 예외를 던집니다. {
System.out.print("스캔.");
throw new Exception("검색할 수 없습니다.");
}
}
클래스 ImagePrinter는 AutoCloseable을 구현합니다. {
public void close()는 예외를 던집니다. {
System.out.print("프린터가 닫혔습니다.");
}
공개 무효 printImage() {System.out.print("인쇄."); }
}
이 코드 조각:
시도(ImageScanner ir = new ImageScanner();
ImagePrinter iw = 새로운 ImagePrinter()) {
ir.scanImage();
iw.printImage();
} catch (Exception e) {
System.out.print(e.getMessage());
}
결과는 무엇입니까?
Correct Answer: B
Vote an answer
주어진 코드 조각:

코드에서 Price 5 New Price 4를 인쇄할 수 있는 수정 사항은 무엇입니까?

코드에서 Price 5 New Price 4를 인쇄할 수 있는 수정 사항은 무엇입니까?
Correct Answer: D
Vote an answer
Student 테이블의 구조가 주어졌을 때:
학생(ID INTEGER, 이름 VARCHAR)
STUDENT 테이블의 레코드가 주어지면:

주어진 코드 조각:

다음과 같이 가정합니다.
결과는 무엇입니까?
학생(ID INTEGER, 이름 VARCHAR)
STUDENT 테이블의 레코드가 주어지면:

주어진 코드 조각:

다음과 같이 가정합니다.
결과는 무엇입니까?
Correct Answer: B
Vote an answer
주어진 코드 조각:
Path path1 = Paths.get("/app/./sys/");
Path res1 = path1.resolve("log");
Path path2 = Paths.get("/server/exe/");
Path res1 = path1.resolve("/readme/");
System.out.println(res1);
System.out.println(res2);
결과는 무엇입니까?
Path path1 = Paths.get("/app/./sys/");
Path res1 = path1.resolve("log");
Path path2 = Paths.get("/server/exe/");
Path res1 = path1.resolve("/readme/");
System.out.println(res1);
System.out.println(res2);
결과는 무엇입니까?
Correct Answer: A
Vote an answer
주어진 코드 조각:
공개 클래스 푸 {
공개 정적 무효 메인 (문자열 [ ] 인수) {
Map<정수, 문자열> unsortMap = 새로운 HashMap< > ( );
unsortMap.put (10, "z");
unsortMap.put (5, "b");
unsortMap.put (1, "d");
unsortMap.put (7, "e");
unsortMap.put (50, "j");
Map<정수, 문자열> treeMap = new TreeMap <정수, 문자열>(새
비교기<정수>( ) {
@Override public int compare (정수 o1, 정수 o2) {return o2.compareTo (o1); } } ); treeMap.putAll(unsortMap); for (Map.Entry<Integer, String> 항목 : treeMap.entrySet()) { System.out.print(entry.getValue() + " ");
}
}
}
결과는 무엇입니까?
공개 클래스 푸 {
공개 정적 무효 메인 (문자열 [ ] 인수) {
Map<정수, 문자열> unsortMap = 새로운 HashMap< > ( );
unsortMap.put (10, "z");
unsortMap.put (5, "b");
unsortMap.put (1, "d");
unsortMap.put (7, "e");
unsortMap.put (50, "j");
Map<정수, 문자열> treeMap = new TreeMap <정수, 문자열>(새
비교기<정수>( ) {
@Override public int compare (정수 o1, 정수 o2) {return o2.compareTo (o1); } } ); treeMap.putAll(unsortMap); for (Map.Entry<Integer, String> 항목 : treeMap.entrySet()) { System.out.print(entry.getValue() + " ");
}
}
}
결과는 무엇입니까?
Correct Answer: A
Vote an answer
주어진:
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; }
}
and the code fragment:
List<Product> products = Arrays.asList(new Product(1, 10),
new Product (2, 30),
new Product (2, 30));
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);
결과는 무엇입니까?
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; }
}
and the code fragment:
List<Product> products = Arrays.asList(new Product(1, 10),
new Product (2, 30),
new Product (2, 30));
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: B
Vote an answer





