Welcome Guest | Sign in | Register
Abstract - Discussion Page For Q.2496 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Abstract > Questions and Answers

Q: Given:
abstract public class Employee {
protected abstract double getSalesAmount();
public double getCommision() {
return getSalesAmount() * 0.15;
}
}

class Sales extends Employee {
**// insert method here
}


Which two methods, inserted independently at line **// insert method here, correctly complete the Sales class? (Choose two.)

A. double getSalesAmount() { return 1230.45; }
B. public double getSalesAmount() { return 1230.45; }
C. private double getSalesAmount() { return 1230.45; }
D. protected double getSalesAmount() { return 1230.45; }
A. AB B. CD
C. BD D. AD

Answer and Explanation

Answer:BD

Explanation:
B and D are correct because whenever you override a method you can increase the visibility but you cannot decrease the visibility.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.