Syntax for Method Overloading

method(int i){}
method(double d){}
method(float f){}
method(int i, float f){}

overloading methods means creating several methods in the same class with exactly the same name, but with other parameters, doesn't need to be the same number of parameters, but it has to be unique for each method, since, if you have two methods with exactly the same name and exactly the same number and type of paramters, the compiler would never be able to tell which one you need once you call one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.