About 30 basic concepts in the J2SE process: In the process of studying Java, mastery of basic concepts to our study, J2SE, J2EE, J2ME is very important, J2se is the foundation of Java, so it is necessary The basic concepts are induced so that everyone can better understand the essence of Java in the future learning process, here I summarize 30 basic concepts.
Java Overview: Currently Java is mainly used in the development of middleware --- Processing communication technology between clients, early practice proves that Java is not suitable for the development of PC applications, and its development has gradually become developed The development of handheld devices, Internet information stations, and car computer. Java is different from other languages that provide the stand-independence of the platform when the program is running, which is highly identical to the exact same code on Windows, Solaris, Linux other operating systems. Java The syntax is similar to the C syntax, and the C / C programmer is easy to master, and Java is a completely thorough object-oriented, which proposes a good Garbage Collector waste handling mechanism to prevent memory overflow. Java's white paper We propose 11 key features of the Java language. (1) Easy: Java syntax is relatively simple than C , and another aspect is Java to run software on a small machine, the basic explanation of its support The size of approximately 40KB, increasing basic standard libraries and thread supported memory needs to increase 125KB. (2) Distributed: Java has a strong routine library with very powerful TCP / IP protocols, Java applications can pass through the URL Network to access remote objects, due to the appearance of the servlet mechanism, making Java programming very efficient, now many large web server supports servlet. (3) oo: object-oriented design is to focus on objects and objects A programming technology. Its object-oriented and C
There are many different, in relation to multiple inheritance and Java's original models. (4) Runtuity: Java adopts a safety pointer model, which can reduce the possible type (5) security of rewriting memory and data crash: Java To design a network and distribution system, this brings new security issues, Java can be used to build antivirus and anti-attack SYSTEM. Facts prove that Java is better to do in the Anti-Virus. (6) Neutral architecture: Java compiles its generating architecture in the target file format that can be executed on many processors, and the compiler generated command bytecode (Javabytecode) implements this feature, this byte code can be explained on any machine. (7) Transplantation: The size and algorithm of the basic data structure type in Java have strict regulations so that the portability is very good. (8) Multi-thread: Java handles multithreading process is very simple, Java puts multi-thread implementation to hand over The system or thread program is complete. So multithreading is one of the popular reasons for Java as a server-side development language (9) applet and servlet: The program that can execute on the web page is applet, which needs to support the Java browser, and Applet supports dynamics The web page, this is what many other languages can't do. Basic concept: 1. The only relationship in OOP is what the object's interface is, just like a computer's sales, he doesn't matter what the internal structure is. No, you will provide you with electricity, that is, just know that CAN or NOT is not how and why. All programs are composed of certain attributes and behavior objects, different objects access through function calls, all between objects Communication is called by way of ways. By increasing the multiplexing rate through the package object data. 2. The most important idea inoo is class, class is a blueprint, constructed an object from the class, that is, this is created. An instance of the class (Instance) 3. Package: Binding the data and behavior in a packet) and the implementation process of the object user hides the data, the data in an object calls his instance field 4. By expanding a class to get a new class called inheritance, all classes are extended by Object root superclass, and the root superclars will be introduced. 5. 3 main features of the object Behavior --- Note What this object can do. State --- When the object is reflected when the method is applied. Identity - distinguishes with other similar behavior objects. Each object has a unique Indentity and this is an interactive influence. 6 The relationship between class: USE-A: Dependent relationship HAS-A: Polymerization Relationship IS-A: Inheritance Relationship - Example: A Class A inherited Class B, at this time, Class A not only has a method of catenium, but also its own method. (Personality exists in commonality) 7. Construct objects The constructor is proposed, the constructor is a special method, constructing the object and initializes it. Example: Data class constructor called Data New Data () --- Constructs a new object and initializes the current time. Data happyday =
NEW data () --- assigns an object to a variable happyday, so that the object can be used multiple times, and the value of the variable and the object variable is different. NEW returns is a reference. Construction Features: The constructor can have 0, one or more parameter constructors and the same names, one class can have multiple constructors, and there is no return value constructor to always be used with the New operator. 8. Heavy Load: When multiple methods have the same name and contain different parameters, the compiler must select which method of calling. 9. Package Java allows one or more classes to become together Group, called packets to facilitate organizational tasks, standard Java libraries are made into many packages. Java.lang Java.util Java, NET, etc., package is all Java packages in Java and JavaX package. 10. Inheritance ideas: Allow new classes on the basis of existing classes, when you inherit an existing class, then you have multiplexed this class, and you can add new categories. Methods and fields. 11. Extended class: Extended class fully reflects the inheritance relationship of IS-A. Form is: Class (subclass) Extends. 12. Polymorphism: In Java, the object variable is polymorphic Multiple inheritance is not supported in Java. 13. Dynamic Binding: Call the mechanism of the object method. (1) The compiler checks the type and method name of the object declaration. (2) Parameter type of the compiler check method call. (3) Static Binding: If the method type is the Priavte Static Final compiler, it will accurately know which method is called. (4) When the program runs and uses a dynamic binding to call a method, then the virtual machine must call the actual object to which X points to the object. Method version of the type matching. (5) Dynamic binding: is a very important feature that makes the program become scalable without need to recompile the modified code. 14.Final class: To prevent others from from your class Delicious new categories, this type is not expandable. 15. Dynamic calls are longer than static calls, 16. Abstract classes: Precurses one or more abstract methods themselves must be defined as Abstract String GetDescripition 17 Each class in .java is extended from the Object class. 18.Oqual and toString method in the 18.Object class. Equal is used to test if an object is equal to another object. TOSTRING returns a string representing the object Almost every class will The method is overloaded to return the correct representation of the current state. (Tostring method is a very important method) 19. Universal programming: All values of any class type can be replaced with the object class variable. 20. A list of groups: ArrayList dynamic array list, is a class library, defined in the Java.uitl package, can automatically adjust the size of the array. 21. The getClass method in the Class class Object class returns an instance of the CKASS type, and the program is included in the main method. The class will be loaded. The virtual machine is to load all the classes he need. Each loaded class is loaded to load the class it needs. 22.class class provides a powerful functional reflection for programming a dynamic manipulation Java code, this Features are especially useful for JavaBeans, using reflection Java to support VB programmers used to use tools. You can analyze the ability of the programming reflector, and the package of this feature in Java is very powerful. 1. The ability to analyze classes at runtime. 2. Objects of the class at runtime. 3. Implement universal array manipulation code. 4. Provide method objects. This mechanism is mainly for tools rather than applications and programs. In reflex mechanism The important part is to allow you to check the structure of the class. The API used by: java.lang.reflect.field returns the field. Java.Reflect.Method Return to the method. Java.lang.Reflect.constructor Returns the parameter. Method pointer: