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

在这里插入图片描述

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

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


版权声明:本文为qq_41359808原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。