JavaRush /Java Blog /Random EN /Dependency Injection. Help the teapot!
BigVOVA
Level 30

Dependency Injection. Help the teapot!

Published in the Random EN group
I’m already using Spring with all my might , where for every “fart” there’s an @autowired. Everything works great, it’s convenient and simply amazing. But at one point I realized that I didn’t understand anything) How does it work? Colleagues! Help me figure it out... Dependency Injection.  Help the teapot!  - 1I'm interested in an example for dummies... How can I inject an instance of one class into a field of another without Spring? Maybe you can give a simple link, or explain in the comments.
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION