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



Ask a Question

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. Different from the others,Good One
View Tutorial          By: Amiiiii java slayer at 2009-10-14 08:10:26

2. The concept is clear.
View Tutorial          By: sam at 2012-08-23 03:52:15

3. hi! im new in j2me applications so i just cleaned
View Tutorial          By: resego at 2010-08-04 07:29:29

4. java is new for me..... since i dont know from bas
View Tutorial          By: m.padma at 2011-08-08 15:40:23

5. thank you so much. i've been fixing this problem o
View Tutorial          By: yo at 2011-06-05 13:25:37

6. If one can't use English grammar correctly and wit
View Tutorial          By: Java Man at 2011-12-09 06:04:14

7. very simple :)
View Tutorial          By: cha at 2012-01-09 07:38:49

8. Very nice one, it really helps me. Thank you very
View Tutorial          By: eky1412 at 2012-09-10 03:45:07

9. what is the use of int getch(void)
and unge

View Tutorial          By: sania at 2014-06-04 17:15:30

10. I want to ask, can a formula be inserted in this s
View Tutorial          By: chika at 2011-02-02 17:18:59