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
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
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
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program 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
Archived Comments
1. Sir , I am doing B.Tech . I want to know more abou
View Tutorial By: Rakesh yadav at 2011-01-18 22:23:22
2. Very Helpful.
View Tutorial By: nfahem at 2012-05-09 10:50:29
3. Thanks it worked. Just remember to restart apache
View Tutorial By: Raj at 2014-02-08 08:42:26
4. well example, but i have to send the received list
View Tutorial By: amit kumar at 2011-02-21 00:43:15
5. great solution and brief explanation, love it.
View Tutorial By: habesha at 2011-12-02 16:14:45
6. Great! Thanks!
View Tutorial By: sciarp at 2008-05-11 05:04:17
7. Hi,
I am using Nokia 3110c connected to PC.
View Tutorial By: Satish Raj at 2009-04-04 07:32:54
8. I wish to implement geocoding and reverse geocodin
View Tutorial By: Leni at 2010-02-25 13:45:41
9. Thanks a lot!
The main reason why we need t
View Tutorial By: SA at 2011-06-24 15:00:13
10. hi....
can u please show me the code for fi
View Tutorial By: pooja at 2012-07-08 16:08:08