Computer Science, asked by shatakshiboyatkar, 3 months ago

e
1
2- public class TestImpl {
3
public int add(int x, int y) {
5
6
7 }
8
}
}
}
I

please implement the following method to return the sum of the two function variables

Answers

Answered by Oreki
5

\text{\bf\large Given Snippet}

   \texttt{public class TestImpl \{}\\\texttt{\hspace{1em} public int add(int x, int y) \{ \}}\\\texttt{\}}

\text{\bf\large Method Implementation}

   \texttt{public class TestImpl \{}\\\texttt{\hspace{1em} public int add(int x, int y) \{}\\\texttt{\hspace{2em} return x + y;}\\\texttt{\hspace{1em} \}}\\\texttt{\}}

Similar questions