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 3726

Given:
10:    public class Hello {
11:    String title;
12:    int value;
13:    public Hello() {
14:    title += " World";
15:    }
16:    public Hello(int value) {
17:    this.value = value;
18:    title = "Hello";
19:    Hello();
20:    }
21:    } and:
30:    Hello c = new Hello(5);
31:    System.out.println(c.title); What is the result?

 

Option A

A.    Hello
 

Option B

B.    Hello World
 

Option C

C.    Compilation fails.
 

Option D

D.    Hello World 5
 

Option E

E.    The code runs with no output.
 

Option F

F.    An exception is thrown at runtime.

Correct Answer C
Explanation


Question ID 3727

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

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