static :
static修饰变量:如,static string ss=“hello”;static 作用是定义了这个变量,被调用时候就不用再实例化了
static修饰方法:如,static void Add(){};static 作用是定义了这个方法,被调用时候就不用再实例化了,但是若在static方法里面要调用其他方法,则这个方法必须是static修饰的, 原因是系统会先执行static定义的内容
static代码块:如,static{};这里的static作用是将这段代码块静态化,调用就不用实例化了
final:
final修饰变量:如,final int a=12;这里final作用可以将a视作常量,不能再对其的值进行修改
final修饰方法:如,final void add(){};这里final作用是:一般final修饰方法就需要该方法你觉得是完美的了,不需要进行扩展了,也不能修改了不能覆盖了
final修饰类:如,final class firstApp{};这里final作用是:final修饰的类除非你这个类是你觉得完美了,不需要进行扩展了,才用,因为一旦用了此类就不能被任何类继承