hello spring
来源:互联网 发布:淘宝上怎么延迟收货 编辑:程序博客网 时间:2024/05/29 18:19
package myspring;public class Age { public String chop(){ return "使用斧头砍柴" ; }}
package myspring;public class Person { private Age age ; public void setAge(Age age) { this.age = age; } public void useAge(){ System.out.println("我打算去砍点柴火"); System.out.println(age.chop()) ; }}
<?xml version="1.0" encoding="UTF-8"?><beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"> <bean id = "person" class = "myspring.Person"> <property name="age" ref = "age"/> </bean> <bean id = "age" class = "myspring.Age"/></beans>
package myspring;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;public class Main { public static void main(String[] args) { ApplicationContext ctx = new ClassPathXmlApplicationContext("bean.xml") ; Person p = ctx.getBean("person" , Person.class) ; p.useAge() ; }}
0 0
- Hello,Spring
- hello spring
- Hello--Spring
- Hello Spring
- Spring、Hello Spring
- 【Spring】Hello Spring
- Spring之Hello World
- spring编写hello world
- Spring之Hello World
- Spring 3.2 Hello World
- Spring Hello World
- Spring入门hello world
- spring mvc Hello World
- Hello Spring MVC
- Spring Hello World 实例
- Spring Hello World 实例
- Spring、Hello AOP
- Spring hello world实例
- 程序平台系统开发修复
- ssh无密码登陆
- 当出现的Interexploer 终止站点的操作的提示框
- Win7上java开发环境搭建
- 在《Android PorterDuff.Mode图形混合处理 》这篇博客中,我们讲解了PorterDuff.Mode对图形混合的处理。这篇我们将通过图形混合的原理,来制作一个手动擦除蒙版显示底层图片
- hello spring
- Java – Convert String to int
- ListView 显示不同布局
- 智能指针 weak_ptr
- c#集合类汇总(上)
- 点击cell,在cell下方创建一个新的cell,再次点击,删除该cell
- 04概要设计说明书
- Switch能否用string做参数?
- leetcode之路050 Pow(x, n)