Question: What is dependency injection?

  1. a method by which objects define dependencies they need as abstractions that allows the framework to instantiate and configure them in a central location at runtime.
  2. a paradigm where dependent code is injected into the bytecode of a Java application on a remote server.
  3. a way of injecting remote dependencies into a pre-packaged JAR file from the file system.
  4. a way of injecting remote dependencies into a pre-packaged WAR file from the file system.

Answer: The correct answer of the above question is Option A:a method by which objects define dependencies they need as abstractions that allows the framework to instantiate and configure them in a central location at runtime.