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

Program using concept of byte long short and int in java

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

Archived Comments

1. very nice approach sir....
u make it very e

View Tutorial          By: aamir at 2011-06-15 01:29:22

2. I have downloaded all the files
SMSClient.j

View Tutorial          By: Sanjay at 2010-06-29 04:48:16

3. Hi, I second that Raghav, kindly can u email me a
View Tutorial          By: SAM at 2011-03-06 05:03:09

4. Thank you, you save my day!!
View Tutorial          By: jano at 2011-05-26 17:20:47

5. i have a shimmer accelerometer(bluetooth). i need
View Tutorial          By: jason at 2012-03-22 04:05:08

6. That was very nice yaar.
View Tutorial          By: sana at 2014-02-21 09:20:34

7. i can't understand the deadlock clearly
View Tutorial          By: kalpana at 2012-11-01 11:26:09

8. the example program is very simple to understand a
View Tutorial          By: Zubilu at 2010-10-06 00:19:13

9. The arraycopy in a System is static native method
View Tutorial          By: Ashwinkumar.vj at 2011-07-19 09:25:02

10. Buenisimo tutorial, este rebuena la cosa
Gr

View Tutorial          By: Popoca at 2010-04-20 15:50:29