Java final class, javafinal class
If the entire class is final (with the final keyword prefixed by its definition), it means that you do not want to inherit from this class, or do not allow anyone else to take this operation. In other words, for one reason or another, we certainly do not need to make any changes to the class; or for security reasons, we do not want to subclass (subclass processing ). In addition, we may also consider execution efficiency and want to ensure that all actions involving all objects of this class are as effective as possible.
/*** Created by xfyou on 2016/11/2. * final class demo *///! Class Further extends din1_ur {}// error: Cannot extend final class 'dinateur 'public class Jurassic {public static void main (String [] args) {din1_ur n = new din1_ur (); n. f (); n. I = 40; n. j ++ ;}} class SmallBrain {}final class din1_ur {int I = 7; int j = 1; SmallBrain x = new SmallBrain (); void f (){}}