草庐IT

java - 你能解释一下 Java 中的 "isXxx"方法名吗?

是否在其中一个规范中引用了以“is”开头的方法,而方法名称的后缀是属性名称(类似于Javabean的getter/setter方法)?例如:publicbooleanisConditionTrue(){......}privatebooleanconditionTrue;谢谢! 最佳答案 这是Java命名约定,Ifthemethodreturnsabooleanvalue,useisorhasastheprefixforthemethodname.Forexample,useisOverdrawnorhasCreditLeftfor