Invalid Method Declaration; Return Type Required
This Java software error message means the return type of a method was not explicitly stated in the method signature.
There are a few ways to trigger the “invalid method declaration; return type required” error:
- Forgetting to state the type
- If the method does not return a value then “void” needs to be stated as the type in the method signature.
- Constructor names do not need to state type. But if there is an error in the constructor name, then the compiler will treat the constructor as a method without a stated type.
0 Comments
Post a Comment