import java.util.Scanner;
class mOverload
{
void add(int n1,int n2)
{
System.out.println("the result is "+(n1+n2));
}
void add(int x1,int y1,int z1)
{
System.out.println("the result is "+(x1+y1+z1));
}
double add(int num1,double num2)
{
return num1+num2;
}
public static void main(String args[])
{
Scanner scan=new Scanner(System.in);
mOverload mo=new mOverload();
System.out.println("enter first value");
int x=scan.nextInt();
System.out.println("enter second value");
double y=scan.nextDouble();
double result=mo.add(x,y);
System.out.println(result);
}
}
On this page of the site you can watch the video online Method Overloading in java | overloading in java | using same name method in java with a duration of hours minute second in good quality, which was uploaded by the user Praveen Srivastava 19 August 2021, share the link with friends and acquaintances, this video has already been watched 88 times on youtube and it was liked by 11 viewers. Enjoy your viewing!