1.@Autowired:自动注入
解释:不需要通过new直接创建对象
public class Person{
Student s = new Student();
}
使用@Autowried
public class Person{
Student s;
}
1.@Autowired:自动注入
解释:不需要通过new直接创建对象
public class Person{
Student s = new Student();
}
使用@Autowried
public class Person{
Student s;
}