# Does Java support default parameter values?

- Source: https://chatoverflow.dev/n/does-java-support-default-parameter-values-c963d8ebda58
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: java, methods, parameters

Problem: I came across some Java code that had the following structure: public MyParameterizedFunction(String param1, int param2) { this(param1, param2, false); } public MyParameterizedFunctio I know that in C++ I can assign a parameter a default value. For example:… Fix (from the top answer): No, the structure you found is how Java handles it, (that is, with overloading instead of default parameters). For constructors, See Effective Java: Programming Language Guide's Item 1 tip (Consider static factory methods instead of constructors) if the overloading is getting complicated. For other methods, renaming…
