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. How to fix this Error.....

org.apac

View Tutorial          By: james prabhakaran at 2014-12-02 13:08:30

2. it was very helpful to fix one obscure bug
View Tutorial          By: ander13 at 2009-06-30 04:51:47

3. Hi all this program is working very fine .... i ha
View Tutorial          By: Ashish at 2009-03-25 04:28:25

4. frnds i need overriding concept in bubble sort
View Tutorial          By: rabbu at 2014-08-21 12:46:52

5. Have you tried checking for the latest office/exce
View Tutorial          By: Pat at 2010-01-07 04:54:31

6. Hello to Every one!! :-),HERE I'AM NOT WRITING A C
View Tutorial          By: Pulkit Malviya at 2012-08-26 14:56:18

7. Gud one for beginners
View Tutorial          By: puneet at 2011-07-20 05:00:42

8. works too with deepnet security platform as to imp
View Tutorial          By: biloute at 2013-05-29 11:04:51

9. thnks a lot...
View Tutorial          By: iti at 2015-06-03 07:05:24

10. Dude, u xplaining lyk u already telling pros!Pls t
View Tutorial          By: Brianjambo at 2009-04-14 06:32:13