package com.springexample; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class RunMyProgram { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); ArithmeticDataHolder arithmeticOperator = (ArithmeticDataHolder) context.getBean("arithmeticDataHolder"); System.out.println("Sum: "+arithmeticOperator.getSum()); System.out.println("Sub: "+arithmeticOperator.getSub()); System.out.println("Mul: "+arithmeticOperator.getMul()); System.out.println("Div: "+arithmeticOperator.getDiv()); System.out.println("Mod: "+arithmeticOperator.getMod()); } }
package com.springexample; public class ArithmeticDataHolder { private float sum; private float sub; private float mul; private float div; private float mod; public float getSum() { return sum; } public void setSum(float sum) { this.sum = sum; } public float getSub() { return sub; } public void setSub(float sub) { this.sub = sub; } public float getMul() { return mul; } public void setMul(float mul) { this.mul = mul; } public float getDiv() { return div; } public void setDiv(float div) { this.div = div; } public float getMod() { return mod; } public void setMod(float mod) { this.mod = mod; } }
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="arithmeticDataHolder" class="com.springexample.ArithmeticDataHolder"> <property name="sum" value="#{23 + 10}" /> <property name="sub" value="#{23 - 10}" /> <property name="mul" value="#{23 * 10}" /> <property name="div" value="#{23 / 10}" /> <property name="mod" value="#{23 % 10}" /> </bean> </beans>
Do you want to delete a "" lesson. Warning! This delete will remove all it's sub lessons and contents.
Do you want to delete a "" sub lesson. Warning! This delete will remove all it's contents.
Do you want to delete content.
Do you want to remove selected book from favorite books.
Do you want to delete selected author from your authors list.