Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

April 29, 2010

Depth First Polymorphism - Java

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:

Mubin Ahmed said...

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.