Free Oracle 1Z0-808 Exam Braindumps (page: 8)

Given the code fragment:
public class Test {
public static void main(String[] args) {
boolean isChecked = false;
int arry[] = {1, 3, 5, 7, 8, 9};
int index = arry.length;
while ( <code1> ) {
if (arry[index-1] % 2 ==0) {
isChecked = true;
}
<code2>
}
System.out.print(arry(index]+", "+isChecked));
}
}
Which set of changes enable the code to print 1, true?

  1. Replacing <code1> with index > 0 and replacing <code2> with index--;
  2. Replacing <code1> with index > 0 and replacing <code2> with --index;
  3. Replacing <code1> with index > 5 and replacing <code2> with --index ;
  4. Replacing <code1> with index and replacing <code2> with --index ;

Answer(s): A

Explanation:

Note: Code in B (code2 is --index;). also works fine.



Given:



What is the result?

  1. 1
  2. 1
  3. 2
  4. Compilation fails
  5. The loop executes infinite times

Answer(s): E



Which two are Java Exception classes?

  1. SercurityException
  2. DuplicatePathException
  3. IllegalArgumentException
  4. TooManyArgumentsException

Answer(s): A,C



Given:



What is the result?

  1. A B C D
  2. A C D
  3. A B C
  4. A B D
  5. A B D C

Answer(s): C



Viewing page 8 of 60
Viewing questions 29 - 32 out of 245 questions



Post your Comments and Discuss Oracle 1Z0-808 exam prep with other Community members:

1Z0-808 Exam Discussions & Posts