Wednesday, January 22, 2014

Out put of of the below java file?

public class Test {
    public void name(String s) {
        System.out.println("vgggg");
    }

    public void name(Number s) {
        System.out.println("mjj");
    }
   


    public static void main(String s[]) {

        Test test = new Test();
        test.name(null);
       
    }

}
Output :
Compile error : The method name(String) is ambiguous for the type Tes

No comments:

Post a Comment