EmSE-Figure7: Difference between revisions
Jump to navigation
Jump to search
Programsam (talk | contribs) No edit summary |
Programsam (talk | contribs) No edit summary |
||
| Line 2: | Line 2: | ||
{| class="wikitable" style="text-align: left; width: 100%;" | {| class="wikitable" style="text-align: left; width: 100%;" | ||
|+ Figure 7. Method <code>addIfPositive</code> | |+ Figure 7. Method <code>addIfPositive</code> | ||
|- | |- | ||
<code> | |||
| | public int addIfPositive | ||
(int a, int b) | |||
{ | |||
if (a >= 0 && b >= 0) | |||
return (a+b); | |||
return -1; | |||
} | |||
</code> | |||
|} | |||
Revision as of 14:23, 5 September 2013
public int addIfPositive
(int a, int b)
{
if (a >= 0 && b >= 0)
return (a+b);
return -1;
}