spring iot – tutorial part 1 – 8

package jtrainer.education.tutorial.spring.ioc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainIoC_Setter {

    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:application-context-ioc-setter.xml");
        Reservation myReservation=ctx.getBean("reservation", Reservation.class);
        System.out.println(myReservation.getRentedCar().getModel());
    }
}