java - Is this called Overloading? -
i have wo methods same name different parameter types , different return types.
public class testoverloading { public void display(){ system.out.println("inside display method of testoverloading class"); } public int display(int i){ system.out.println("inside display method of testoverloading class values "+ i); return 0; } }
output: following code works fine no errors in jdk 1.6.
is called overloading? if not, why not?
if methods has same name , different parameters called overloaded methods. return type not matter.
Comments
Post a Comment