https: instructure.com /courses 1233754lquizzes/1197998/take M Gmail Google Docs
ID: 3841873 • Letter: H
Question
https: instructure.com /courses 1233754lquizzes/1197998/take M Gmail Google Docs On LinkedIn teBay Canvas Sound cloud a YouTube (P Question 24 Given: class Employee private String name; void setNameCString n) name n; string getNameO{ return name; interface Student void doHomewor public class StudentHelper implements Student public void doHomeworkO public static void mainCStringO args) Employee e new EmployeeO; e.setNamec Peter"); System out.printce.getNameO); Which is true? The code is loosely coupled StudentHelper is-a Employee StudentHelper has-a Student G The Employee class is not well encapsulated StudentHelper has-a EmployeeExplanation / Answer
True answer is
The Code is Loosely coupled.
Explaination :
Loose coupling is achieved by means of a design that promotes single-responsibility and separation of concerns.
A loosely-coupled class can be consumed and tested independently of other (concrete) classes.
Interfaces are a powerful tool to use for decoupling. Classes can communicate through interfaces rather than other concrete classes, and any class can be on the other end of that communication simply by implementing the interface.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.