Is this valid Java?

It depends upon how you wish to call these methods. If you wish to call these methods from other Java source code, then it is considered invalid for reasons illustrated in Edwin’s answer. This is a limitation of the Java Language. However, not all classes need to be generated from Java source code (consider all … Read more