public class NumbersTest {
public static void main(String[] args) {
add(5);
}
public static void add(int s) {
System.out.println("int");
}
public static void add(Integer s) {
System.out.println("Integer");
}
public static void add(long s) {
System.out.println("long");
}
public static void add(Long s) {
System.out.println("Long");
}
public static void add(double s) {
System.out.println("double");
}
public static void add(Double s) {
System.out.println("Double");
}
public static void add(String s) {
System.out.println("String : I am in add method");
}
public static void add(StringBuffer s) {
System.out.println("StringBuffer : I am in add method");
}
}
Out put : int
public static void main(String[] args) {
add(5);
}
public static void add(int s) {
System.out.println("int");
}
public static void add(Integer s) {
System.out.println("Integer");
}
public static void add(long s) {
System.out.println("long");
}
public static void add(Long s) {
System.out.println("Long");
}
public static void add(double s) {
System.out.println("double");
}
public static void add(Double s) {
System.out.println("Double");
}
public static void add(String s) {
System.out.println("String : I am in add method");
}
public static void add(StringBuffer s) {
System.out.println("StringBuffer : I am in add method");
}
}
Out put : int
No comments:
Post a Comment