TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Java - Method Overloading Concept
Senthilvelan Sambamoorthy
Jul 30
2016
Code
499
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
class
methover
{
void
sum(
int
a,
int
b)
{
System.
out
.println(
"integer value : "
+(a+b));
}
void
sum(
double
a,
double
b)
{
System.
out
.println(
"double value : "
+(a+b));
}
void
sum(
float
a,
float
b)
{
System.
out
.println(
"float value : "
+(a+b));
}
void
sum(
byte
a,
byte
b)
{
System.
out
.println(
"byte value : "
+(a+b));
}
void
sum(
short
a,
short
b)
{
System.
out
.println(
"short value : "
+(a+b));
}
void
sum(
long
a,
long
b)
{
System.
out
.println(
"long value : "
+(a+b));
}
void
sum(String a, String b)
{
System.
out
.println(
"string value : "
+(a+b));
}
public
static
void
main(String arg[])
{
methover t =
new
methover();
t.sum(5,10);
t.sum(10.3,14.2);
t.sum(5.3,3.2);
t.sum(100,-50);
t.sum(10000,-20000);
t.sum(250,200);
t.sum(
"ssv"
,
"ksv"
);
}
}
Java
Method Overloading Concept