FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java_sneha/MethodOver.java at main · Snehatiwari2425/java_sneha · GitHub
Snehatiwari2425
/
java_sneha
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java_sneha
/
MethodOver.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (32 loc) · 851 Bytes
Breadcrumbs
java_sneha
/
MethodOver.java
Copy path
File metadata and controls
41 lines (32 loc) · 851 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package
Day3Task
;
//method overloading
public
class
MethodOver
{
public
static
int
add
(
int
a
,
int
b
)
//no .of argument 2
{
int
sum
=
a
+
b
;
return
sum
;
}
public
static
int
add
(
int
a
,
int
b
,
int
c
)
//no.of argument 3
{
int
total
=
a
+
b
+
c
;
return
total
;
}
public
static
float
multiply
(
int
a
,
float
b
) {
//type of argument is int and float
float
m
=
a
*
b
;
return
m
;
}
public
static
float
multiply
(
int
a
,
int
b
) {
//type of argument is int
float
m
=
a
*
b
;
return
m
;
}
public
static
void
main
(
String
[]
args
) {
int
total
=
add
(
2
,
3
);
System
.
out
.
println
(
"sum="
+
total
);
int
sum
=
add
(
2
,
3
,
4
);
System
.
out
.
println
(
"sum="
+
sum
);
float
m
=
multiply
(
2
,
5.2f
);
System
.
out
.
println
(
"result="
+
m
);
float
f
=
multiply
(
5
,
5
);
System
.
out
.
println
(
"result="
+
f
);
}
}
Back
|
FazBrowse Home
|
New Git URL