Complete the code to declare a method named add that takes two integers and returns their sum.
public int add(int a, int b) {
return a [1] b;
}The + operator adds two integers.
Complete the code to overload the add method to accept two double values and return their sum.
public double add(double a, double b) {
return a [1] b;
}The + operator adds two double values.
Fix the error in the overloaded method that adds three integers.
public int add(int a, int b, int c) {
return a [1] b [2] c;
}To add three integers, use the plus operator between all variables.
Fill both blanks to create an overloaded method that concatenates two strings.
public String add(String a, String b) {
return a [1] b;
}In Java, the + operator concatenates strings.
Fill all three blanks to overload the add method for three double values.
public double add(double a, double b, double c) {
return a [1] b [2] c;
}Use the plus operator + to add all three double values.
