Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
Overloading refers to defining multiple methods with the same name but different parameters within a single class. The methods must have different parameter lists or different types of parameters.
Similar to overriding, method signature is important in overloading as well. It includes the method name and parameter list, which must be unique for each overloaded method.
Compile-time Polymorphism: Overloading is an example of compile-time polymorphism because the decision on which overloaded method to call is made by the compiler at compile time.
Default Arguments: In some programming languages, default arguments allow you to specify default values for parameters in case they are not provided when calling an overloaded method.