What is the maximum number of parameters a static Java method can have?

The story behind the answer

A static Java method can have at most 255 parameters when each parameter consumes one JVM parameter slot, so the stored answer is 255. This is a limit imposed by the Java Virtual Machine’s method-descriptor format, not an arbitrary style rule in the Java language.

The important technical wording is “parameter slots.” Most ordinary types—such as int, reference types, byte, boolean, and float—use one slot. The long and double types use two slots, so a method containing those types reaches the limit with fewer than 255 declared parameters. A static method has no implicit this reference, which is why all 255 slots can be used for its parameters.

For comparison, an instance method effectively has one fewer available slot for declared parameters because the JVM invocation includes the object reference as this. A method with 255 int parameters can therefore be static, while an instance method cannot have that same all-one-slot arrangement.

This limit is easy to confuse with nearby numbers such as 256 or 127. It is not the number of local variables, nor the maximum method size. The class-file and JVM specifications define the descriptor limit, and Java compilers enforce it when translating source code into bytecode. In real programs, such a large parameter list is usually a design smell; a parameter object or collection is clearer.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: