My First Post
Hi frnds I know the name of community is new to java. but i feel posts are real good ones. anyways I want to put a small question I'm sure many of u will be able to answer this question... Thx in advance
public class AQuestion
{
public void method(Object o)
{
System.out.println("Object Verion");
}
public void method(int s)
{
System.out.println("Integer Version");
}
public void method(StringBuffer s)
{
System.out.println("String Buffer Version");
}
public static void main(String args[])
{
AQuestion question = new AQuestion();
question.method(null);
}
}
why is that output is coming out to be String Buffer Version and not Integer Version or Object Version. Why Prefernce is given to StringBuffer(although StringBuffer or String is wrapper class)..
thx again

