package com.spring.factory2;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Test {
public static void main(String[] args) {
ApplicationContext appContext = new ClassPathXmlApplicationContext("beans-factory2.xml");
Car2 car = (Car2)appContext.getBean("car2");
System.out.println(car);
}
}
package com.spring.factory2;public class Car2 { private int brand; private double price; public Car2(int brand,double price){ this.price = price; this.brand = brand; } public int getBra