public int addIfPositive (int a, int b) { if (a >= 0 && b >= 0) return (a+b); return -1; }
Figure 7. Method addIfPositive