public class StringTest {
public static void main(String args[]){
add(null);
}
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");
}
}
O/P : compile time error - The method add(String) is ambiguous for the type
StringTest
public static void main(String args[]){
add(null);
}
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");
}
}
O/P : compile time error - The method add(String) is ambiguous for the type
StringTest
No comments:
Post a Comment