FileDocCategorySizeDatePackage
AddNumbersImpl.javaAPI DocExample2661Tue May 29 17:13:48 BST 2007fromjava.server

AddNumbersImpl

public class AddNumbersImpl extends Object

Fields Summary
Constructors Summary
Methods Summary
public intaddNumbers(int number1, int number2)

param
number1
param
number2
return
The sum
throws
AddNumbersException if any of the numbers to be added is negative.

        if (number1 < 0 || number2 < 0) {
            throw new AddNumbersException("Negative number cant be added!",
                "Numbers: " + number1 + ", " + number2);
        }
        return number1 + number2;