常用final修饰的类
final关键字代表最终、不可改变的
一个类如果是final的,那么其中所有的成员方法都无法进行覆盖重写
可以用来修饰一个类
可以用来修饰一个方法。
还可以用来修饰一个局部变量
还可以用来修饰一个成员变量
插入链接与图片
格式:
public final class 类名称 {
}
包装类:Boolean,Character,Short,Integer,Long,Float,Double,Byte,Void
字符串类:String,StringBuilder,StringBuffer
系统类:Class,System,RuntimePermission,Compiler
数学类:Math,StrictMath
class Scratch {
public static void main(String[] args) {
System.out.println();
}
}
public class SubScrach extends Scratch{
public static void main(String[] args) {
System.out.println();
}
}