rgb192
asked on
why is it wrong to combine interface and abstract class; acquire the method externally?
interface printer{
printToScreen(){}
printToPrinter(){}
printToCellPhone(){}
sendToFax(){}
}
computer implements printer
cableBox tv box implements printer
cable router implements router
all 3 of these classes must print
may be easier to create abstract class than to keep on creating new methods and copy pasting those methods into all classes
abstract class AllPrintingMehods(){
printToScreen(){}
printToPrinter(){}
printToCellPhone(){}
sendToFax(){}
}
why is it wrong to combine interface and abstract class
why is wrong to acquire the method externally?
printToScreen(){}
printToPrinter(){}
printToCellPhone(){}
sendToFax(){}
}
computer implements printer
cableBox tv box implements printer
cable router implements router
all 3 of these classes must print
may be easier to create abstract class than to keep on creating new methods and copy pasting those methods into all classes
abstract class AllPrintingMehods(){
printToScreen(){}
printToPrinter(){}
printToCellPhone(){}
sendToFax(){}
}
why is it wrong to combine interface and abstract class
why is wrong to acquire the method externally?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.