Function overloading
Function overloading is a programming-language feature in which one name denotes multiple callable signatures or implementations distinguished by parameter types or forms, with applicability determined by the call or context.
100 Java Mistakes and How to Avoid Them
A method overload is one of multiple methods with the same name but different parameter lists in a class or interface.
- How it is used
- Prevents unintended Java call binding when overloaded methods, constructors, method references, or boxed numeric arguments obscure the selected signature.
- How deep it goes
- Explains overload selection through focused failures and corrections, without detailing Java's full overload-resolution rules.
- Examples
- Uses `StringBuilder::new` in `computeIfAbsent`, `List<Integer>.remove(0)`, and `process(Object)` alongside typed overload migration.
- What you can do after
- Diagnose/debug with it by exposing target parameters, forcing intended argument types, checking parameter hints, and migrating broad APIs to typed overloads.
Read how 100 Java Mistakes and How to Avoid Them explains function overloading →
Software Design for Python Programmers
Function overloading is providing the same operation through multiple signatures or argument forms with behavior selected according to the call.
- How it is used
- Uses one name for closely related operations that accept different argument counts or datatypes.
- How deep it goes
- Explains naming criteria, Python's replacement behavior, runtime checks, and decorator-based dispatch, stopping short of formal language semantics.
- Examples
- Demonstrates overloaded area calculations, line lengths from points and coordinate containers, the plus operator, and len().
- What you can do after
- Build it from scratch using runtime checks or the multimethod decorator to dispatch related calls by argument form and datatype.
Read how Software Design for Python Programmers explains function overloading →
Object-Oriented Software Design in C++
The definition of multiple functions with the same name but different parameter lists or signatures in a scope.
- How it is used
- Uses one name for closely related operations whose behavior varies with argument types or counts.
- How deep it goes
- Explains signatures, compiler selection, and suitable behaviors through compact C++ examples.
- Examples
- Demonstrates print, draw_circle, search, sqrt, and overloaded operators for arithmetic, strings, and enumerations.
- What you can do after
- Apply function overloading in C++ when related operations need distinct parameter signatures under one name.
Read how Object-Oriented Software Design in C++ explains function overloading →
Also covered in
- Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools
- Essential TypeScript 5, Third Edition
- Julia as a Second Language
- Secrets of the JavaScript Ninja, Third EditionIn early access (MEAP)
- 100 C++ Mistakes and How to Avoid Them
- Idiomatic Rust
What to know first
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- class hierarchyA class hierarchy is an organization of related classes connected by inheritance relationships, typically from more general base classes to more specialized derived classes.
- compile-time errorA compile-time error is a violation or failure detected during compilation or static checking that prevents source code from being successfully translated into a program representation.
- complexityComplexity is the degree to which interacting elements or factors make a system or problem difficult to understand, predict, change, operate, or solve.
Related concepts
- JavaScriptcontrasts with · JavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.
- default valuealternative to · A default value is a predefined value automatically applied when no explicit value is supplied or specified.
- argumentsimplemented by · The JavaScript arguments object is an array-like object available inside non-arrow functions that exposes the values passed to the current function invocation.
- C++used by · C++ is a statically typed, general-purpose programming language that supports procedural, object-oriented, generic, and low-level systems programming.
- multimethodimplemented by · A multimethod is a dispatch mechanism that selects an implementation by applying a dispatch function to multiple arguments, often using their runtime types or values.
Questions about function overloading
What is function overloading?
Function overloading is a programming-language feature in which one name denotes multiple callable signatures or implementations distinguished by parameter types or forms, with applicability determined by the call or context.
Which Manning books explain function overloading?
100 Java Mistakes and How to Avoid Them, Software Design for Python Programmers and Object-Oriented Software Design in C++.
What should I know before learning function overloading?
Manning books that teach function overloading usually introduce function, class hierarchy, compile-time error and complexity first.
What is the difference between function overloading and JavaScript?
Function overloading is a programming-language feature in which one name denotes multiple callable signatures or implementations distinguished by parameter types or forms, with applicability determined by the call or context. JavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.
What is function overloading also called?
Function overloading is also called overloads, overloaded function or method overloading.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


