Comment on Tutorial - Method Overloading sample in Java By Ganesh Iyer



Comment Added by : Subhojit Das

Comment Added at : 2014-10-09 07:31:20

Comment on Tutorial : Method Overloading sample in Java By Ganesh Iyer
//Program of Method Overloading with Runtime Values

import java.util.Scanner;


class cal
{
void add(int a,int b)
{
System.out.print("Addition of First 2No.s is : " +(a+b));
}

void add(int a,int b,int c)
{
System.out.print("Addition of Three No.s is : " +(a+b+c));
}

}

class mthdovrng
{
public static void main (String args[])
{
int a,b,c;
Scanner input=new Scanner(System.in);
System.out.print("Enter First No. : ");
a=input.nextInt();
System.out.print("Enter Second No. : ");
b=input.nextInt();
System.out.print("Enter Third No. : ");
c=input.nextInt();
cal ob=new cal();
ob.add(a,b);
ob.add(a,b,c);
}
}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Java program to check if user input is an even number

Archived Comments

1. Microsoft VB.net 2008 not showing Crystal Report V
View Tutorial          By: Ali at 2011-11-30 03:21:00

2. hi everybody....

please use comm.j

View Tutorial          By: manoj at 2012-09-24 10:41:34

3. Thanks for giving iterator example
View Tutorial          By: Rajesh Kumar at 2010-11-03 05:17:05

4. But I have the same error ("javax.net.ssl.SSL
View Tutorial          By: azeemuddin at 2010-03-04 07:25:33

5. Hii I m Ravi. This is a good example.
Here

View Tutorial          By: Ravi at 2011-02-17 09:09:06

6. Good day. I managed to get the code working but I
View Tutorial          By: thabiso at 2011-06-03 09:08:24

7. Very good example .. i ve written this program . P
View Tutorial          By: gomz at 2011-09-26 12:33:54

8. clear concept explanation..
View Tutorial          By: ASHOK at 2013-01-16 07:31:35

9. thanks becase i am very confuse what is work how t
View Tutorial          By: arvind at 2011-01-09 14:41:42

10. dear sir/mam
i execute the above downloaded

View Tutorial          By: tamilarasan.D at 2010-12-05 05:20:19