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 -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -