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 3687

Given:
31.    class Foo {
32.    public int a = 3;
33.    public void addFive() { a += 5; System.out.print("f "); }
34.    }
35.    class Bar extends Foo {
36.    public int a = 8;
37.    public void addFive() { this.a += 5; System.out.print("b " ); }
38.    } Invoked with: Foo f = new Bar(); f.addFive(); System.out.println(f.a); What is the result?
 

Option A

A.    b 3
 

Option B

B.    b 8
 

Option C

C.    b 13
 

Option D

D.    f 3
 

Option E

E.    f 8
 

Option F

F.    f 13
 

Correct Answer A
Explanation


Question ID 3688

Given:
11.    class Animal { public String noise() { return "peep"; } }
12.    class Dog extends Animal {
13.    public String noise() { return "bark"; }
14.    }
15.    class Cat extends Animal {
16.    public String noise() { return "meow"; }
17.    } ...
30.    Animal animal = new Dog();
31.    Cat cat = (Cat)animal;
32.    System.out.println(cat.noise()); What is the result?

 

Option A

A.    peep
 

Option B

B.    bark
 

Option C

C.    meow
 

Option D

D.    Compilation fails.
 

Option E

E.    An exception is thrown at runtime.

Correct Answer E
Explanation

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