没有在int前加static报错。
错误原因:
mian()方法时静态方法,而自己定义的那个方法如果不加static是成员方法,成员方法无法在静态方法中调用。
Non-static method 'xxx cannot be referenced from a static context原因之一
猜你喜欢
转载自blog.csdn.net/qq_38534524/article/details/89963986
今日推荐
周排行