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 3679

Given:
11.    public class ItemTest {
12.    private final int id;
13.    public ItemTest(int id) { this.id = id; }
14.    public void updateId(int newId) { id = newId; }
15.    
16.    public static void main(String[] args) {
17.    ItemTest fa = new ItemTest(42);
18.    fa.updateId(69);
19.    System.out.println(fa.id);
20.    }
21.    }
What is the result?
 

Option A

A.    Compilation fails.
 

Option B

B.    An exception is thrown at runtime.
 

Option C

C.    The attribute id in the ItemTest object remains unchanged.
 

Option D

D.    The attribute id in the ItemTest object is modified to the new value.
 

Option E

E.    A new ItemTest object is created with the preferred value in the id attribute.
 

Correct Answer A
Explanation


Question ID 3680

Given:
13.    public class Pass {
14.    public static void main(String [] args) {
15.    int x = 5;
16.    Pass p = new Pass();
17.    p.doStuff(x);
18.    System.out.print(" main x = " + x);
19.    }
20.    
21.    void doStuff(int x) {
22.    System.out.print(" doStuff x = " + x++);
23.    }
24.    }
What is the result?

Option A

A. Compilation fails.
 

Option B

B.    An exception is thrown at runtime.
 

Option C

C.    doStuff x = 6 main x = 6
 

Option D

D.    doStuff x = 5 main x = 5
 

Option E

E.    doStuff x = 5 main x = 6
 

Option F

F.    doStuff x = 6 main x = 5
 

Correct Answer D
Explanation

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