I am going through this link , OBJ10-J. Do not use public static nonfinal fields and it says that ,
Client code can trivially access public static fields because access to such fields are not checked by a security manager.
what do they actually mean by that? i.e what do they mean by escaping from security manager?
If they simply meant it because field being non-final and public
, then how come non-final , public
instance fields different than their static
counterparts? ( as far as code security is concerned )
I have been through this question and have not seen any mention in terms of security , Why are static variables considered evil
public
class's public static
fields would be accessible from anywhere and so public
instance fields too, so where is the difference? Why non-final public
instance fields not a security issue but being static
is?