Classes are encapsulation, inheritance, and polymorphism encapsulation. They reflect details hiding and permission control, and inheritance reflects the hierarchy of classes, polymorphism represents the Declaration Form of classes in different java implementations with the same method name as follows [java] [modifier] class name [extends parent class] [implements interface name] {attribute (member variable) -> basic data type, object operation (member method)-> function} class declaration modifiers include public, abstract, final note: the application class is public and a java file can only have one public class abstract class. No instance final class cannot be accessed by the inheritance class, that is, the object of the class is declared or the class is inherited, obviously, abstract and final cannot modify a class at the same time, otherwise it doesn't make sense. during compilation, the either abstract or final prompt will be displayed, the Declaration Form of not both member variables is as follows: [modifier] variable type variable name [= initial variable value] modifiers include public, protected, private, private protected, static, the finalstatic variable is equivalent to the global variable [java] class Account {static int num = 0;} public class cam2 {public static void main (String args []). {Account a = new Account ();. num ++; System. out. println (. num); Account B = new Account (); B. num ++; System. out. println (B. num); System. out. println (Account. num); // Account. num is equivalent to the global variable} And is output as 122. Here you can set the Account. num is treated as the global variable final, which is equivalent to a constant, cannot be changed. For example, adding 1 to the maximum Integer is obviously not allowed [java] public class cam2 {public static void main (String args []) {Integer. MAX_VALUE ++; System. out. println (Integer. MAX_VALUE) ;}} The final field Integer is prompted during compilation. MAX_VALUE cannot be assigned member variables can be not only basic data types, but also objects. For example, [java] class Table {int record = 0; void addrecord () {record ++ ;}} class Database {Table t1; Table t2; Table t3; void InitDatabase () {t1 = new Table (); t2 = new Table (); t3 = new Table () ;}} public class cam5 {public static void main (String args []) {Database db = new Database (); db. initDatabase (); db. t1.addrecord (); System. out. println (db. t1.record) ;}}the modifiers output as the declaration of the 1 member method include public, protected, private, static, abstract, the finalstatic method can only process static modified member variables. The abstract method can only appear in the abstract class. Methods without method body final modification cannot be overwritten by the quilt class.