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

Home > Java Programming > Interface > Questions and Answers

Q: Interface pet{
Void eat();
}

Class dog implements pet{
Public void eat(){}
}

Class Beagle extends dog{
Public void eat(){}
}

Which of the following demonstrate the”program to an interface ” principle?
A. class petfood{
public void go(Pet p){
p.eat();}}
B. class petfood{
public void go(dog p){
p.eat();}}
C. class petfood{
public void go(Beagle p){
p.eat();}}
D. class petfood extends pet {
public void go(Petfood p){
p.eat();}}

Answer and Explanation

Answer:class petfood{
public void go(Pet p){
p.eat();}}

Explanation:
There is no explanation...

Comment on this Question

Name:

Loading...




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