Writing to a static variable in an instance method, why is this a bad practice?

后端 未结 6 1881
故里飘歌
故里飘歌 2020-12-15 06:43

I am a little confused here with this findbugs warning in eclipse.

public class MyClass {
    public static String myString;
}


public class AnotherClass {         


        
6条回答
  •  一整个雨季
    2020-12-15 07:18

    This is what FindBugs has to say about this: http://findbugs.sourceforge.net/bugDescriptions.html#ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD

提交回复
热议问题