摘要: Q:什么样的方法应该用static修饰?不用static修饰的方法往往具有什么特性?Student的getName应该用static修饰吗? A:当一个方法需要初始化加载或者经常被调用的时候可以加上static。不用static修饰的方法不能直接调用,需要先进行实例化。不应该,因为student是非 阅读全文
posted @ 2021-09-23 21:24 箱推人 阅读(81) 评论(1) 推荐(0) 编辑