摘要: 一、什么样的方法应该用static修饰?不用static修饰的方法往往具有什么特性?Student的getName应该用static修饰吗? static 修饰方法的适用场景 应该用 static 修饰的方法: 方法与对象的状态无关,只依赖传入的参数完成功能(如 Math.sqrt() )。 工具类 阅读全文
posted @ 2025-09-21 20:52 计算机糕手 阅读(14) 评论(0) 推荐(0)