Tuesday, 10 June 2014

Function Overloading

class Overload
{
  static void show(int a)
{
  System.out.println("Overloaded int A="+a);
}
static void show(float a)
{
  System.out.println("Overloaded Float A="+a);
}
public static void main(String []args)
{
  show(4);            //No need to call by object as method is static
  show(5.0f);
  }
}

No comments:

Post a Comment