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. I need to get the brief notes on this example

View Tutorial          By: Racchana Srini at 2014-07-29 07:50:22

2. how to read any xml file or i want to a universal
View Tutorial          By: shankar lal at 2014-09-29 12:40:20

3. Hi I need code examples J2ME for chating aplicatio
View Tutorial          By: agus at 2010-04-03 04:16:11

4. i like google
View Tutorial          By: parikh dhruti at 2013-02-12 06:43:19

5. Thanx u m at lab..n u made me complete my prog!
View Tutorial          By: Liza at 2009-12-09 23:03:51

6. these above examples of overloading and overriding
View Tutorial          By: janmejay pant at 2011-03-02 22:06:16

7. It'z to hard to study a computer programming.but i
View Tutorial          By: christine idio at 2009-10-20 02:06:58

8. How to connect a webpage(which I have created for
View Tutorial          By: sam at 2012-01-24 10:10:52

9. thanks for your tutorial, but how to us it?

View Tutorial          By: Desman Gea at 2014-07-18 16:54:41

10. I will not contest. Certainly this is extremely im
View Tutorial          By: Bangabee at 2012-11-10 18:17:40