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 3913

Given:
10.    public class SuperCalc {
11.    protected static int multiply(int a, int b) { return a * b;}
12.    } and:
20.    public class SubCalc extends SuperCalc{
21.    public static int multiply(int a, int b) {
22.    int c = super.multiply(a, b);
23.    return c;
24.    }
25.    } and:
30.    SubCalc sc = new SubCalc ();
31.    System.out.println(sc.multiply(3,4));
32.    System.out.println(SubCalc.multiply(2,2));
What is the result?
 

Option A

A.    12
4
 

Option B

B.    The code runs with no output.
 

Option C

C.    An exception is thrown at runtime.
 

Option D

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

Option E

E.    Compilation fails because of an error in line 22.
 

Correct Answer E
Explanation


Question ID 3914

Given:
3.    class Employee {
4.    String name; double baseSalary;
5.    Employee(String name, double baseSalary) {
6.    this.name = name;
7.    this.baseSalary = baseSalary;
8.    }
9.    }
10.    public class SalesPerson extends Employee {
11.    double commission;
12.    public SalesPerson(String name, double baseSalary, double commission) {
13.    // insert code here
14.    }
15.    }
Which two code fragments, inserted independently at line 13, will compile? (Choose two.)
 

Option A

A.    super(name, baseSalary);
 

Option B

B.    this.commission = commission;

 

Option C

C.    super();
this.commission = commission;
 

Option D

D.    this.commission = commission; super();
 

Option E

E.    super(name, baseSalary);
this.commission = commission;
 

Option F

F.    this.commission = commission;
super(name, baseSalary);
 

Correct Answer A,E
Explanation

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