Which two are Java Exception classes?
Show answerHide answer
Correct answer: A, C
SercurityException IllegalArgumentException
Java SE 8 Programmer I
Find out if you're ready for 1z0-808. Take the free timed mock exam and get your score in minutes, or study the free 1z0-808 questions below with answers and explanations.
20 questions · 33 minutes · free, no sign-up
Which two are Java Exception classes?
Correct answer: A, C
SercurityException IllegalArgumentException
Given the code fragment
Which code fragments, inserted independently, enable the code compile?
Correct answer: B
cvar = 400;
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?
Correct answer: A
Replacing <code1> with index > 0 and replacing <code2> with index--;
Note: Code in B (code2 is -index;). also works fine.

What is the result?
Correct answer: C
String main 1
Which of the following exception will be thrown due to the statement given here?
int array[] = new int[-2];
Correct answer: B
NegativeArraySizeException
In given statement we can see that, we have passed negative value for creating int array,
which results a NegativeArraySize Except ion. Hence option B is correct.
Option A is incorrect as it is thrown when an application attempts to use null in a case
where an object is required.
Option D is incorrect as IndexOutOfBoundsException thrown to indicate that an index of
some sort (such as to an array, to a string, or to a vector) is out of range.
REFERENCE
rhttpy/docs.oracle.com/iavase/S/docs/api/java/lang/NegativeArraySizeException.html
Which two statements are true for a two-dimensional array of primitive data type?
Correct answer: C, D
At the declaration time, the number of elements of the array in each dimension must be All methods of the class object may be invoked on the two-dimensional array.
specified.
http://stackoverflow.com/questions/12806739/is-an-array-a-primitive-type-oran-
object-or-something-else-entirely
Given the code fragment:
Which two modifications should you make so that the code compiles successfully?
Correct answer: A, C
Option A Option C
Add throws clause in both printFileContent and main

Correct answer: A, C
Option A Option C
Given:
public class MainMethod {
void main() {
System.out.println("one");
}
static void main(String args) {
System.out.println("two");
}
public static void main(String[] args) {
System.out.println("three");
}
void mina(Object[] args) {
System.out.println("four");
}
}
What is printed out when the program is excuted?
Correct answer: C
three

Correct answer: C
Option C
Full-length mocks with the same number of questions and the same time limit as the real 1z0-808 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.
Get full 1z0-808 mock exam