一、装配一个bean

二、依赖注入的几种方式

峰Spring4学习(2)依赖注入的几种方式

com.cy.entity   People.java:

package com.cy.entity;

public class People {
    private int id;
    private String name;
    private int age;
    
    public People() {
        super();
        // TODO Auto-generated constructor stub
    }
    public People(int id, String name, int age) {
        super();
        this.id = id;
        this.name = name;
        this.age = age;
    }
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    @Override
    public String toString() {
        return "People [>;
    }
    
    
}
View Code

相关文章:

  • 2021-08-18
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
  • 2022-01-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-05-31
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案