问题
I just begin to use PMD. I can't fix in my code PMD violation : "Use explicit scoping instead of the default package private level".
It appears on these places in my code:
String carName = ""; //car name
String carSize = ""; //car size
String carColor = "";//car color
ArrayList<Car> carList = new ArrayList();
static MyLog log = new MyLog(); //log
How to fix it?
回答1:
With regards to explicit scoping, make your fields private to enforce encapsulation
来源:https://stackoverflow.com/questions/26791038/pmd-violation-use-explicit-scoping-instead-of-the-default-package-private-leve