The static method xxx from the type xxxshould be accessed in a static way

在这里插入图片描述

static的方法直接用类名调用就可以了

新建一个对象调用static方法会造成空间浪费
所以编译器会有警告

猜你喜欢

转载自blog.csdn.net/qq_41359808/article/details/88716133
今日推荐