Question: Which of the principles is broken using the following code: package org.example.controllers; import org.example.logic.HelloWorldService; public class HelloWorldController { private HelloWorldService helloWorldService = new HelloWorldService (
Which of the principles is broken using the following code:
package org.example.controllers;
import org.example.logic.HelloWorldService;
public class HelloWorldController
private HelloWorldService helloWorldService new HelloWorldService;
public String greet
return "The message is :: this.helloWorldService.getMessage;
Question options:
Single Responsibility Principle
Dependency Inversion Principle
Interface Segregation Principle
Liskov Substitution Principle
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
