Is dependency injection possible if we don't have inheritance / Composition ?
Questions
Search
List By Company
List By Topic
Legacy
Tests
Repository
DashBoard
Java
Java 8
Java 7
Java Abbreviations
OCJP / SCJP
Class List
New in Java 8
Java Exceptions
Spring Exceptions
Java Enums
Java 8 Lambda
Java 8 java.time
Big Data
Best Of Java
Discussion
Search
Subscribe
Search Interview Questions
More than 3000 questions in repository.
There are more than 900 unanswered questions.
Click here
and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company
Label / Company / Text
Search
Submit Question
Interview Questions and Answers
Q1.
Is dependency injection possible if we don't have inheritance / Composition ?
Design
Ans. Without composition - No, as it's the core of dependency injection.
With Inheritance - Yes, through interface implementation.
Help us improve. Please let us know the company, where you were asked this question
:
Like
Discuss
Correct / Improve
 dependency injection  inversion of control  ioc
Correction
Duplicate of Another Question
Company where this question was Asked
Suggestion
Related Questions
What is Dependency Injection or IOC ( Inversion of Control ) ?
What are the benefits of Dependency Injection or IOC ?
What are different types of dependency injections ?
Name few Dependency Injection frameworks ?
Why do we need polymorphism in Java ?
What are the various Auto Wiring types in Spring ?
What is the difference betweeen @Inject and @Autowired ?
Which of the following Java features facilitates Dependency Injection - Inheritance or Composition ?
What are the different ways in which dependency injection can be done using Spring Framework ?
Difference between constructor and setter injection ?
Help us and Others Improve. Please let us know the questions asked in any of your previous interview.
Any input from you will be highly appreciated and It will unlock the application for 10 more requests.
Company Name:
Questions Asked: