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 summarized so that everyone can better understand the essence of Java in the future learning process, I summarized 30 basic concepts. Java Overview: The current Java is mainly used in middleware development (MiddleWare --- Treatment of communication technology between clients from servers, early practice proves that Java is not suitable for the development of PC applications, and its development has gradually become developed in the development of handheld equipment, Internet information stations, and car computer. Java Different from other languages provide the independence of the platform, which is prone to using the exact same code on Windows, Solaris, Linux other operating systems. Java syntax is similar to C syntax, C / C programmers are easy Master, and Java is a completely thorough object-oriented, which proposed a good GARBAGE COLLEctor waste handling mechanism to prevent memory overflow. Java's white paper proposes 11 key features of Java language. (1) Easy: Java syntax is relatively simple than C , and another aspect is that Java can run software on a small machine. The basic explanation of its support for its support is about 40KB, increasing basic standard libraries and thread support. Memory needs to increase 125kb. (2) Distributed: Java has a strong routine library with very powerful TCP / IP protocols, Java applications can pass the network through the network to access the remote object, due to the appearance of the servlet mechanism, make Java Programming is very efficient, now many big Web Server supports servlet. (3) OO: Object-oriented design is a programming technology on the interface of objects and objects. Its object-oriented and C have a lot of differences, Treatment with multiple inheritance and the original model of Java. (4) Runtight characteristics: Java adopts a safety pointer model to reduce possible (5) security of rewriting memory and data crash: Java is used to design networks and Distribution system, which brings new security issues, and Java can be used to build antivirus and anti-attack SYSTEM. Facts prove that Java is better in the Anti-Virus. (6) Neutral architecture: Java compiles its build system The structure of the structure can be executed on many processors, and the compiler generated command bytecode 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 cannot be done.
Basic Concept: 1. The only relationship in OOP is what the object's interface is, just like the computer's seller, she doesn't matter if the internal structure of the power supply, he only does it give you electricity, but just know if CAN or NOT instead of how and why. All programs are composed of certain properties and behavior objects, different objects access through function calls, all exchanges between objects are called by way of ways, through the package object data, very Maximum reserves. 2. The most important idea inoo is class, class is a blueprint, constructed an object from the class, that is, an instance of this class (Instance) 3. Package: That is to put data In combination with behavior in a package) and the implementation process of the object user hide the data, the data in an object calls his instance field (INSTANCE FIELD) 4. Get a new class inheritance (inheritance) by expanding a class And all classes are expanded by Object root superclass, and the root superclars will be introduced. 5. 3 main features of the object Behavior --- Describe what this object can do. State --- When the object is applied The method of the method is reflected in the object. Identity - distinguishes with other similar behavior objects. Each object has unique INDENTITY and the three interacts between this 3. 6. Relationship between class: USE-A: Dependence HAS -A: Polymerization Relationship IS-A: Inheritance Relationship - Example: A Class A inherited Class B, at which time A category not only has Class B, but also its own method. (personality exists in commonality) 7. Construction object uses a constructor: The constructor is proposed, the constructor is a special method, constructing the object and initializes it. Example: Data class constructor called Data New Data () --- Construct a new object, and initialize 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 Characteristics: The constructor can have 0, one or more parameter constructors and the same names. A class can have a plurality of constructors that have no return value constructors always use together with the New operator. 8. 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 divided 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 supported in Java. 13. Dynamic Binding: Mechanism of calling an object method. (1) The compiler checks the type and method name of the object declaration. (2) The compiler check the parameter type. (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. Every class in .java is extended from the Object class. 18.Object class Equal and toString methods. Equal is used to test whether an object is equal to another object. TOSTRING returns a string representing the object, almost every class overloads the method to return the correct representation of the current state. (Tostring method is a very important method 19. Universal Programming: All values of any class can be replaced with object class variables. 20. Array list: ArrayList Dynamic array list, is a class library, defined in the java.uitl package, automatic adjustment array The size. 21. The getClass method in the Class class Object class returns an instance of the CKASS type. The class containing the main method when the program is started. The virtual machine is loaded with all the classes he need, each loaded class Loading the class it needs. 22.class class provides powerful feature reflection for writing a dynamic manipulating Java code, which is especially useful for JavaBeans, using reflection Java to support VB programmers used to use tools. To analyze classes The ability of the ability to call the reflector, and the package of this feature in Java is very powerful. 1. The ability to analyze class at runtime. 2. Object of the class at runtime. 3. Implement universal array Manipulating code. 4. Provides method objects. This mechanism is primarily for tools rather than applications and programs. The most important part of the reflex mechanism is to allow you to check the structure of the class. Use the API: java.lang.reflect .Field returns the field. Java.Reflect.Method returns the method. Java.lang.Reflect.constructor Returns the parameter. Method pointer: