Oracle Java SE 8 Programmer II (1z0-809 Korean Version) - 1z0-809 Korean 模擬練習

주어진 코드 조각:
public static void main(String [ ] args) IOException {
BufferedReader br = 새로운 BufferedReader(새로운 InputStremReader(System.in)); System.out.print("GDP 입력: ");
//라인 1
}
1행에 삽입할 때 코드가 사용자로부터 GDP를 읽을 수 있도록 하는 코드 조각은 무엇입니까?

正解: D
주어진:
항목 테이블
* 아이디, 정수: PK
* 설명, VARCHAR(100)
* 가격, 실제
* 수량< 정수
그리고 주어진 코드 조각:
9. try {
10.Connection conn = DriveManager.getConnection(dbURL, username, password);
11. String query = "Select * FROM Item WHERE ID = 110";
12. Statement stmt = conn.createStatement();
13. ResultSet rs = stmt.executeQuery(query);
14.while(rs.next()) {
15.System.out.println("ID:" + rs.getInt("Id"));
16.System.out.println("Description:" + rs.getString("Descrip"));
17.System.out.println("Price:" + rs.getDouble("Price"));
18. System.out.println(Quantity:" + rs.getInt("Quantity"));
19.}
20. } catch (SQLException se) {
21. System.out.println("Error");
22. }
다음과 같이 가정합니다.
필수 데이터베이스 드라이버는 클래스 경로에 구성됩니다.
dbURL, userName 및 passWord가 있는 적절한 데이터베이스에 액세스할 수 있습니다.
SQL 쿼리가 유효합니다.
결과는 무엇입니까?

正解: C

결과는 무엇입니까?

正解: C
주어진 코드 조각:
클래스 호출자는 Callable<String> {을 구현합니다.
문자열 str;
공개 호출자(문자열 s) {this.str=s;}
공개 문자열 call() 예외 발생 { return str.concat("호출자");}
}
클래스 러너는 Runnable {을 구현합니다.
문자열 str;
공개 러너(문자열 s) {this.str=s;}
공개 무효 실행() { System.out.println(str.concat("실행자"));}
}
그리고
public static void main(String[] args)는 InterruptedException, ExecutionException을 던집니다. { ExecutorService es = Executors.newFixedThreadPool(2); 미래 f1 = es.submit(새 발신자("호출")); 미래 f2 = es.submit(새로운 러너("실행")); 문자열 str1 = (문자열) f1.get(); 문자열 str2 = (문자열) f2.get();//라인 n1 System.out.println(str1+ ":" + str2);
}
결과는 무엇입니까?

正解: D
주어진:
class Student {
String course, name, city;
public Student (String name, String course, String city) {
this.course = course; this.name = name; this.city = city;
}
public String toString() {
return course + ":" + name + ":" + city;
}
and the code fragment:
List<Student> stds = Arrays.asList(
new Student ("Jessy", "Java ME", "Chicago"),
new Student ("Helen", "Java EE", "Houston"),
new Student ("Mark", "Java ME", "Chicago"));
stds.stream()
.collect(Collectors.groupingBy(Student::getCourse))
.forEach(src, res) -> System.out.println(scr));
결과는 무엇입니까?

正解: C
주어진 코드 조각:

결과는 무엇입니까?

正解: A
주어진 코드 조각:

결과는 무엇입니까?

正解: D
주어진:
class Book {
int id;
String name;
public Book (int id, String name) {
this.id = id;
this.name = name;
}
public boolean equals (Object obj) { //line n1
boolean output = false;
Book b = (Book) obj;
if (this.name.equals(b name))}
output = true;
}
return output;
}
}
및 코드 조각:
책 b1 = 새 책(101, "자바 프로그래밍");
책 b2 = 새 책(102, "자바 프로그래밍");
System.out.println (b1.equals(b2)); //라인 n2
어떤 말이 진실이야?

正解: D
주어진 코드 조각:
Path path1 = Paths.get("/app/./sys/");
Path res1 = path1.resolve("log");
Path path2 = Paths.get("/server/exe/");
Path res1 = path2.resolve("/readme/");
System.out.println(res1);
System.out.println(res2);
결과는 무엇입니까?

正解: D
주어진 코드 조각:
public void recDelete(String dirName)에서 IOException {이 발생합니다.
File [ ] listOfFiles = new File (dirName) .listFiles();
if (listOfFiles ! = null && listOfFiles.length >0) {
for (File aFile : listOfFiles) {
if (!aFile.isDirectory ()) {
if (aFile.getName ().endsWith (".class"))
aFile.delete ();
}
}
}
}
Projects에 .class 파일이 포함된 하위 디렉터리가 포함되어 있고 호출될 때 recDelete() 메서드에 인수로 전달된다고 가정합니다.
결과는 무엇입니까?

正解: B
주어진 코드 조각:

Course 열거형의 올바른 정의는 무엇입니까?

正解: B
다음 코드 조각을 참고하세요.

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

正解: A
주어진:

함수형 인터페이스를 사용하여 리팩토링된 코드는 무엇입니까?

正解: D
주어진 코드 조각:

결과는 무엇입니까?

正解: A