Engineering Full Stack Apps with Java and JavaScript
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(); }