In the process of studying Java, master the basic concepts to our study, whether it is J2SE, J2EE, J2ME, J2SE is the foundation of Java, so it is necessary to summarize the basic concepts so that everyone Better understanding of Java in the future, I summarized 30 basic concepts. Java overview: The current Java is mainly used in the Middleware development (MiddleWare) --- Processing clients between servers Communication technology, early practice prove, Java is not suitable for the development of PC applications, and its development gradually becomes the development of handheld equipment, Internet information stations, and car computer. Java is different from other languages to provide procedures. The stand-alone of the platform, the exact same code can be used on Windows, Solaris, Linux other operating systems. Java syntax is similar to C syntax, and C / C programmers are easy to master, and Java is completely thoroughly object-oriented. Among them, a good GARBAGE COLLEctor is presented to prevent memory overflow. Java's white paper proposes 11 key features of Java language. (1) Easy: Java syntax is relatively simple than C , Another aspect is that Java can run software on a small machine, the basic explanation of its support for its support for its support for about 40kB, increasing the basic standard library and thread supported memory needs to increase 125KB. (2) Distributed: Java has a strong routine library of TCP / IP protocols, and Java applications can pass the network through the URL to access remote objects, due to the appearance of the servlet mechanism, making Java programming very efficient, now many big web Server supports servlet. (3) OO: Object-oriented design is a programming technology on an interface of objects and objects. Its object-oriented and C have a lot of differences, in relation to multiple inheritance and Java's original model model (4) Running characteristics: Java adopted a safety pointer model to reduce the likelihood of rewriting memory and data crash.
(5) Safety: Java is used to design a network and distribution system, which brings new security issues, and Java can build antivirus and anti-attack SYSTEM. Facts prove that Java is better in this area of the Antirate. (6) Neutral Architecture: Java compiles its generating architecture neutral target file format can be executed on many processors, and the compiler generated command bytecode (Javabytecode) implements this feature, this byte code can be on any machine Explanation execution. (7) Portability: Java has strict regulations on the size and algorithm of basic data structure types, so the portability is very good. (8) Multi-thread: Java handles multithreading process is very simple, Java put Multi-thread implementation is handed over to the operating system or thread program. So multithreading is one of the popular reasons for Java as a server-side development language (9) Applet and servlet: The program that can be executed on the web page is applet, you need to support Java browsing There are many powers, and Applet supports dynamic web pages. This is a lot of other languages. Basic concept: 1. The only relationship in OOP is what the object's interface is, just like a computer sales, it is the internal structure of the power supply. What, however, can he only 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 To do, all communication between the objects are called by way of ways, and the multiplex rate is improved by the package object data. 2. The most important idea inoo is class, the class is a blueprint, constructed from the class An object, an instance of this class (Instance) 3. Package: Incoming data and behavior in a package) and the implementation process of the object user hides the data, the data in an object calls him instance Instance Field 4. By expanding a class to get a new class inheritance, all classes are extended by Object root superclass, and the root superclars will be introduced. 5. 3 object 3 Main Features Behavior --- Describes what this object can do. State --- Reflection of the object when the object is applied. Identity --- distinguishing the mark with other similar behavior objects. Each object has the only Indentity and this 3 The relationship between the class: Uses-a: Dependence HAS-A: Polymer Relationship IS-A: Inheritance Relationship - Example: A Class A inherited Class B, at this time, Class A is not only Class B method, there is also its own method. (Personality exists in commonality) 7. Constructing objects use constructor: constructor It is proposed that 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 Every class in .java is extended from the Object class. 18.Object class Equal and toString method .Equal is used to test if an object is equal to another object. TOSTRING returns a string representing the object Almost every class will overload this method in order 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 array: arraylist dynamic array list, is A class library, defined in a java.uitl package, automatically adjusts the size of the array. 21. The getClass method in the Class class Object class returns an instance of the CKASS type. The program containing the main method when the program starts will be loaded, virtual The machine must load all the classes he need. Each loaded class must load it needs the class. 22.class class provides powerful functional reflection for programming the program that can dynamically manipulate Java code, this feature is especially useful for JavaBeans. Using reflection Java can support the tools used to use the VB programmer. 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 class at runtime 2. Objects of the class at runtime. 3. Implement universal array manipulation code. 4. Provide method objects. This mechanism is primarily for tools rather than applications. The most important part of the reflex mechanism is allowed to allow you Check the structure of the class. Use the API: java.lang.reflect.field Return to the field. Java.Reflect.Method Return to the method. The address is transmitted to another method, and it can be called later, and the interface is a better solution. 23. Interface indicates what the class does not specify how to do it, a class can implement one or more interface . 24. The interface is not a class, but a set of specifications for classes that meet the interface requirements. If an interface requires 2 steps: