public class DepthFirstPoly {
public void Test(Object obj){
System.out.println("Obj");
}
public void Test(String obj){
System.out.println("String");
}
/*public void Test(StringBuffer obj){
System.out.println("String");
}*/
public static void main(String[] args) {
//System.out.println();
DepthFirstPoly dfs = new DepthFirstPoly();
dfs.Test(null);
}
}
Output :
String
1 comment:
Hi Pragya,
Nice to see such good topics on your blog. One suggestion though, along with the implementation part, it will be really nice if you include a short description. Like, for this topic, a novice may not even know what "depthi first polymorphism" is.
Post a Comment