Abstraction

Quiz Guidelines

 

Multiple Choice Question

QID: 
189

Which of these statements about interfaces are true?

Select 3 options

A. Interfaces permit multiple implementation inheritance.
B. Unlike a class, an interface can extend from multiple interfaces.
C. Members of an interface are never static.
D. Members of an interface may be static.
E. Interfaces cannot be final.

Multiple Choice Question

QID: 
188

Given:

interface Worker {   
void  performWork(); 
} class FastWorker  implements Worker {  
 public void  performWork(){ } 
} 

You are creating a class that follows "program to an interface" principle. Which of the following line of code will you most likely be using?

Select 1 option 

A. public FastWorker getWorker(){ return new Worker(); } 
B. public FastWorker getWorker(){ return new FastWorker(); } 
C. public Worker getWorker(){ return new FastWorker(); } 
D. public Worker getWorker(){ return new Worker(); } 

Pages