AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-851





Question ID 3915

Given:
11.    class A {
12.    public void process() { System.out.print("A,"); }
13.    class B extends A {
14.    public void process() throws IOException {
15.    super.process();
16.    System.out.print("B,");
17.    throw new IOException();
18.    }
19.    public static void main(String[] args) {
20.    try { new B().process(); }
21.    catch (IOException e) { System.out.println("Exception"); }
22.    }
What is the result?

Option A

A. Exception
 

Option B

B.    A,B,Exception
 

Option C

C.    Compilation fails because of an error in line 20.
 

Option D

D.    Compilation fails because of an error in line 14.
 

Correct Answer D
Explanation


Question ID 3916

Given a method that must ensure that its parameter is not null:
11.    public void someMethod(Object value) {
12.    // check for null value ...
20.    System.out.println(value.getClass());
21.    }
What, inserted at line 12, is the appropriate way to handle a null value?
 

Option A

A. assert value == null;
 

Option B

B. assert value != null, "value is null";
 

Option C

C. if (value == null) {
throw new AssertionException("value is null");
}
 

Option D

D. if (value == null) {
throw new IllegalArgumentException("value is null");
}
 

Correct Answer D
Explanation

Send email to admin@getfreedumps for new dumps request!!!