你定义的main函数是static类型,而display不是,当然不能够访问了,是可以这样写:
System.out.println(a.display);
就没有问题了