Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- int X = 1, Y = 2, Z = 3;
- Add(X, Y);
- Add(X, Y, Z);
- }
- public static void Add(int first, int second) {
- int sum = first + second;
- System.out.println("The sum of the two variables is: " + sum);
- }
- public static void Add(int first, int second, int third) {
- int sum = first + second + third;
- System.out.println("The sum of the three variables is: " + sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement