math

2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 package com.bl.beans; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; public class Math implements InitializingBean, DisposableBean { private int i; private int j; private int sum; public Math(int i) { System.out.println("Math() created.."); this.i = i; } @Override public void destroy() throws Exception { System.out.println("destroying..."); } @Override public void afterPropertiesSet() throws Exception { this.sum = this.i + this.j; System.out.println("afterPropertiesSet()"); } public void startup() { System.out.println("startup()"); } public void setJ(int j) { this.j = j; } public void shutdown() { System.out.println("shutdown...."); } Math.java 18-Jun-16 6:25 AM Page 1 of 2

Upload: subashnayak999

Post on 08-Jul-2016

212 views

Category:

Documents


0 download

DESCRIPTION

import org.springframework.beans.factory.DisposableBean;import org.springframework.beans.factory.InitializingBean;

TRANSCRIPT

123456789

10111213141516171819202122232425262728293031323334353637

package com.bl.beans;

import org.springframework.beans.factory.DisposableBean;import org.springframework.beans.factory.InitializingBean;

public class Math implements InitializingBean, DisposableBean {private int i;private int j;private int sum;

public Math(int i) {System.out.println("Math() created..");this.i = i;

}

@Overridepublic void destroy() throws Exception {

System.out.println("destroying...");}

@Overridepublic void afterPropertiesSet() throws Exception {

this.sum = this.i + this.j;System.out.println("afterPropertiesSet()");

}

public void startup() {System.out.println("startup()");

}

public void setJ(int j) {this.j = j;

}

public void shutdown() {System.out.println("shutdown....");

}

Math.java 18-Jun-16 6:25 AM

Page 1 of 2

3839404142434445

@Overridepublic String toString() {

return "Math [i=" + i + ", j=" + j + ", sum=" + sum + "]";}

}

Math.java 18-Jun-16 6:25 AM

Page 2 of 2