// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package dynamic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("test")
public class TestImpl implements Test {
	@Autowired
	private IntMath im;
	@Autowired
	private DoubleMath dm;
    public void test() {
        System.out.println("Start");
        try {
            System.out.println("2+3=" + im.add(2, 3));
            System.out.println("2.0*3.0=" + dm.multiply(2.0, 3.0));
            System.out.println("10/0=" + im.divide(10, 0));
        } catch (Exception ex) {
            System.out.println("Exception: " + ex.getMessage());
        }
        System.out.println("End");
    }
}
