inheritance - Is there any annotation to warn that subclasses shouldn't hide a static method in Java -


i have class contains public static method in java. there annotation in java warn subclasses not use same method signature(and thereby hide superclass method). other workarounds fine.

just make superclass method final:

class foo {     public static final void go() {} }  class bar extends foo {     public static void go() {};  // error } 

ideone example


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

android - IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling -