[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] The static field xxx.yyy should be accessed in a static way

How do we disable the yellow mark for this:
    The static field xxx.yyy should be accessed in a static way

In my opinion, static fields should not always be accessed in a static
manner, since that reduces the information hiding and hence it is less OO.

X x=new X()
x.setColor(x.RED)

You change your mind that you want to use type Y instead, no problem (as
long as X and Y share signatures):

Y x=new Y() //only line changed
x.setColor(x.RED)

--
CB