Respuesta :
Answer:
The explanation of this code is give below in explanation section.
Explanation:
public class MultipleSalutations {
public static void printSalutation(String personName) {
System.out.println("Hello, " + personName);
return;
}
public static void printSalutation(String personName, String customSalutation) /* this method will take two string parameter and print custom salutation*/
{
System.out.println(customSalutation+ " "+personName);//print custom salutation
}
public static void main (String [] args) {
printSalutation("Holly", "Welcome");
printSalutation("Sanjiv");
return;
}
}
Answer:
public static void printSalutation ( String personName, String customSalutation ){
System.out.println( customSalutation + ", " + personName );
}
Explanation: