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 3778

Given:
1.    class ClassA {
2.    public int numberOfInstances;
3.    protected ClassA(int numberOfInstances) {
4.    this.numberOfInstances = numberOfInstances;
5.    }
6.    }
7.    public class ExtendedA extends ClassA {
8.    private ExtendedA(int numberOfInstances) {
9.    super(numberOfInstances);
10.    }
11.    public static void main(String[] args) {
12.    ExtendedA ext = new ExtendedA(420);
13.    System.out.print(ext.numberOfInstances);
14.    }
15. }
Which statement is true?
 

Option A

A.    420 is the output.
 

Option B

B.    An exception is thrown at runtime.
 

Option C

C.    All constructors must be declared public.
 

Option D

D.    Constructors CANNOT use the private modifier.
 

Option E

E.    Constructors CANNOT use the protected modifier.
 

Correct Answer A
Explanation


Question ID 3779

Given:
5.    class Building { }
6.    public class Barn extends Building {
7.    public static void main(String[] args) {
8.    Building build1 = new Building();
9.    Barn barn1 = new Barn();
10.    Barn barn2 = (Barn) build1;
11.    Object obj1 = (Object) build1;
12.    String str1 = (String) build1;
13.    Building build2 = (Building) barn1;
14.    }
15.    }
Which is true?
 

Option A

A. If line 10 is removed, the compilation succeeds.
 

Option B

B.    If line 11 is removed, the compilation succeeds.
 

Option C

C.    If line 12 is removed, the compilation succeeds.
 

Option D

D.    If line 13 is removed, the compilation succeeds.
 

Correct Answer C
Explanation

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