-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTest.java
More file actions
26 lines (21 loc) · 718 Bytes
/
Test.java
File metadata and controls
26 lines (21 loc) · 718 Bytes
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
package src;
public class Test {
// Static method adding two int numbers.
public static int add(int first, int second) {
return (first + second);
}
// Overloaded static method adding two double type numbers.
public static double add(double first, double second) {
return (first + second);
}
// Overloaded static method concatenating two Strings.
public static String add(String first, String second) {
return (first + second);
}
// main driven function.
public static void main(String[] args) {
System.out.println(add(32, 32));
System.out.println(add(3.2, 32.78));
System.out.println(add("Muhammad ", "Naveed"));
}
}