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. Hi There Busy doing a project and found that i cou
View Tutorial          By: Steven Owen Nell at 2010-09-05 13:32:01

2. Thanks!
Please point me to a site which di

View Tutorial          By: TERRY DEGLOW at 2012-01-29 16:04:41

3. If you use comments you will have better idea abou
View Tutorial          By: Mohammed Homam at 2009-12-06 04:43:51

4. Please, I need help, how can i write a program &qu
View Tutorial          By: LULU at 2012-11-23 01:34:07

5. It is the same as #include
View Tutorial          By: Ballu at 2011-07-04 06:42:55

6. hi,am working on this project..sending SMS from P
View Tutorial          By: rajesh at 2008-12-10 00:16:10

7. better..................
implements........

View Tutorial          By: sunny at 2012-01-04 17:30:12

8. Java is very queit Langauge.
View Tutorial          By: Ashutosh Srivasatava at 2008-10-16 06:24:02

9. file reader is good but file writer is worst
View Tutorial          By: sachinmani at 2010-03-01 04:34:22

10. required the flag set loop stutruce .............
View Tutorial          By: savita at 2013-05-12 04:52:30