1z0-809 Korean試験無料問題集「Oracle Java SE 8 Programmer II (1z0-809 Korean Version) 認定」
주어진:
클래스 Sum extends RecursiveAction { //라인 n1
정적 최종 정수 THRESHOLD_SIZE = 3;
정수 stIndex, lstIndex;
정수 [ ] 데이터;
public Sum (int [ ]data, int start, int end) {
this.data = data;
this stIndex = start;
this. lstIndex = end;
}
protected void compute ( ) {
int sum = 0;
if (lstIndex - stIndex <= THRESHOLD_SIZE) {
for (int i = stIndex; i < lstIndex; i++) {
sum += data [i];
}
System.out.println(sum);
} else {
new Sum (data, stIndex + THRESHOLD_SIZE, lstIndex).fork( );
new Sum (data, stIndex,
Math.min (lstIndex, stIndex + THRESHOLD_SIZE)
).compute ();
}
}
}
및 코드 조각:
ForkJoinPool fjPool = 새로운 ForkJoinPool( );
정수 데이터 [ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
fjPool.invoke(새로운 합계(데이터, 0, 데이터 길이));
1부터 10까지의 모든 정수의 합은 55라고 가정합니다.
어떤 말이 진실이야?
클래스 Sum extends RecursiveAction { //라인 n1
정적 최종 정수 THRESHOLD_SIZE = 3;
정수 stIndex, lstIndex;
정수 [ ] 데이터;
public Sum (int [ ]data, int start, int end) {
this.data = data;
this stIndex = start;
this. lstIndex = end;
}
protected void compute ( ) {
int sum = 0;
if (lstIndex - stIndex <= THRESHOLD_SIZE) {
for (int i = stIndex; i < lstIndex; i++) {
sum += data [i];
}
System.out.println(sum);
} else {
new Sum (data, stIndex + THRESHOLD_SIZE, lstIndex).fork( );
new Sum (data, stIndex,
Math.min (lstIndex, stIndex + THRESHOLD_SIZE)
).compute ();
}
}
}
및 코드 조각:
ForkJoinPool fjPool = 새로운 ForkJoinPool( );
정수 데이터 [ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
fjPool.invoke(새로운 합계(데이터, 0, 데이터 길이));
1부터 10까지의 모든 정수의 합은 55라고 가정합니다.
어떤 말이 진실이야?
正解:A
解答を投票する
주어진:
클래스 FuelNotAvailException 확장 예외 { }
클래스 차량 {
void ride()가 FuelNotAvailException {//라인 n1을 발생시킵니다.
System.out.println("행복한 여행!");
}
}
class SolarVehicle extends Vehicle {
public void ride () throws FuelNotAvailException {//line n2
super ride ();
}
}
and the code fragment:
public static void main (String[] args) throws Exception {
Vehicle v = new SolarVehicle ();
v.ride();
}
코드 조각이 Happy Journey!를 인쇄할 수 있도록 하는 수정 사항은 무엇입니까?
클래스 FuelNotAvailException 확장 예외 { }
클래스 차량 {
void ride()가 FuelNotAvailException {//라인 n1을 발생시킵니다.
System.out.println("행복한 여행!");
}
}
class SolarVehicle extends Vehicle {
public void ride () throws FuelNotAvailException {//line n2
super ride ();
}
}
and the code fragment:
public static void main (String[] args) throws Exception {
Vehicle v = new SolarVehicle ();
v.ride();
}
코드 조각이 Happy Journey!를 인쇄할 수 있도록 하는 수정 사항은 무엇입니까?
正解:D
解答を投票する
Course.txt에 액세스할 수 있으며 다음이 포함됩니다.
코스 :: 자바
코드 조각이 주어지면 :
공개 정적 무효 메인(문자열[ ] 인수) {
int i;
char c;
try (FileInputStream fis = new FileInputStream ("course.txt");
InputStreamReader isr = new InputStreamReader(fis);) {
while (!isr.close()) { //line n1
isr.skip(2);
i = isr.read ();
c = (char) i;
System.out.print(c);
}
} catch (Exception e) {
e.printStackTrace();
}
}
결과는 무엇입니까?
코스 :: 자바
코드 조각이 주어지면 :
공개 정적 무효 메인(문자열[ ] 인수) {
int i;
char c;
try (FileInputStream fis = new FileInputStream ("course.txt");
InputStreamReader isr = new InputStreamReader(fis);) {
while (!isr.close()) { //line n1
isr.skip(2);
i = isr.read ();
c = (char) i;
System.out.print(c);
}
} catch (Exception e) {
e.printStackTrace();
}
}
결과는 무엇입니까?
正解:C
解答を投票する





