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. THANX FOR THE INFO....
View Tutorial          By: Abhinaykumar at 2010-07-06 11:34:53

2. very nice i now understand what the allocated part
View Tutorial          By: Digistr - digistrscape (youtube.com/digistrscape) at 2010-01-30 01:17:19

3. plz can u give me code for key excange b/n pda &am
View Tutorial          By: visnas at 2009-05-04 20:18:32

4. Thanks for the syntax, this has really helped me u
View Tutorial          By: Ketobbey at 2010-04-30 19:01:29

5. There something at Example #2! because when i try
View Tutorial          By: Paul at 2011-08-01 14:38:14

6. Hi to all,

I worked on this project

View Tutorial          By: Ashish Agrawal at 2013-06-05 08:38:16

7. really very-2 good site....

thanks

View Tutorial          By: Priti at 2012-02-06 03:00:13

8. yaar this example is easy to understand but other
View Tutorial          By: richa at 2009-09-08 13:52:37

9. Thanks for this section. Clears most of my doubts.
View Tutorial          By: Melvin at 2008-07-05 04:54:19

10. Hello, I have been using a very similar code on de
View Tutorial          By: Rod at 2011-11-13 15:09:52