Sobes.tech
Junior — Senior

Spring context initialization and BeanA bean retrieval

livecode

Task condition

Create a Spring context and obtain the BeanA bean using the getBean method. Requirements:

  1. Launch the Spring context.
  2. Define BeanA and its dependencies as Spring beans.
  3. Call getBean(BeanA.class) to get an instance.
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class JetbulbInterview {
    public static void main(String[] args) {
        // Launch Spring application
        
        // getBean(BeanA.class);
    }
}

class BeanA {}

class BeanB {}

class BeanDependencyA {}

class BeanDependencyB {}