A
abdul82
Please go through this simple program it should show " Number ... n"
but it is showing
"float a"at run time. I am using jdk 5.0
public class VarArg1 {
public void take()
{
System.out.println("no arg");
}
public void take(Number ... n)
{
System.out.println("Number ... n");
}
public void take(Double ... n)
{
System.out.println("Double ...n");
}
public void take(float a)
{
System.out.println("float a");
}
public void take(double a)
{
System.out.println("double a");
}
public static void main(String[] args) {
new VarArg1().take(2); // it Should show Number ... n but is is
showing float a
}
}
Abdul Mohsin
(e-mail address removed)
but it is showing
"float a"at run time. I am using jdk 5.0
public class VarArg1 {
public void take()
{
System.out.println("no arg");
}
public void take(Number ... n)
{
System.out.println("Number ... n");
}
public void take(Double ... n)
{
System.out.println("Double ...n");
}
public void take(float a)
{
System.out.println("float a");
}
public void take(double a)
{
System.out.println("double a");
}
public static void main(String[] args) {
new VarArg1().take(2); // it Should show Number ... n but is is
showing float a
}
}
Abdul Mohsin
(e-mail address removed)