Package org.apache.examples

Examples of org.apache.examples.Calculator


        double arg1 = Double.parseDouble(args[1]);

        AnnotatedRegistryBuilder builder = new AnnotatedRegistryBuilder();
        TypedRegistry registry = builder.constructRegistry(CalculatorModule.class);
       
        Calculator calculator = registry.getService(Calculator.class);

        System.out.println("Inputs:   " + arg0 + " and " + arg1);
        System.out.println("Add:      " + calculator.add(arg0, arg1));
        System.out.println("Subtract: " + calculator.subtract(arg0, arg1));
        System.out.println("Multiply: " + calculator.multiply(arg0, arg1));
        System.out.println("Divide:   " + calculator.divide(arg0, arg1));


        registry.shutdown();
    }
View Full Code Here

TOP

Related Classes of org.apache.examples.Calculator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.