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's garbage 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) O Object-Oriented design is a programming technology on an interface of objects and objects. It is 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 By way of ways? By increasing the multiplexing rate in the package object data. 2.oo is the most important thinking in the class, the class is a blueprint, constructed a object from the class, that is, this is created. A instance of the class (Instance) 3. Package: Binding the data and behavior in a package) 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, and all classes are extended by Object root superclass, and the root super class will be introduced. 5. 3 main features of the object Behavior --- Note What this object can do. State --- When an object is applied to the method of the object. Identity --- distinguishing between the other similar behavior objects. Each object has a unique Indentity and the three interactions between these 3. Relationship between class: USE-A: Dependence HAS-A: Aggregation Relationship IS-A: Inheritance Relationship - Example: A Class A inherited Class B, at this time, Class A not only has Class B method, but also its own method. (Personality) Existed in the commonality) 7. Construction object uses a constructor: presentation, constructor is a special method, constructing an object and initializes it. Example: Data class constructor called Data New Data () --- Construct a new object and initialize 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 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 method. Equal is used to test whether an object is the same as another object Wait. Tostring returns a string representing the object, almost every class overloads the method to return the correct representation of the current state. (TSTRING method is a very important method) 19. Universal programming: All types of all types Values can be replaced with Object category .20. An array list: ArrayList dynamic array list, is a class library, defined in the java.uitl package, can automatically adjust the size of the array. 21.Class class Object class GetClass method Returns an instance of the CKASS type. The class containing the main method when the program starts will be loaded. The virtual machine is to load all the classes he need. Each loaded class is loaded. The class is loaded. 22.class class Writing a program that can dynamically manipulate Java code provides powerful feature reflection, which is especially useful for JavaBeans, using reflection Java to support VB programmers used to use tools. Can analyze the programming reflector, Java provides this The functional package is called java.lang.Reflect reflex mechanism 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. The mechanism is primarily targeted instead of application and program. The most important part of the reflex mechanism is to allow you to check the structure of the class. The use of the API is: java.lang.reflect.field Return to the field. Java.Reflect.Method Return Method. Java.lang.Reflect.constructor Returns the parameters. Method Pointer:
Java has no method pointer, passing the address of a method to another, can call it later, and the interface is a better solution. 23. Interface indicates what the class does not specify how to do it, one Categories 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: 1. The specified interface that needs to be implemented. 2. Provide definitions of all methods in the interface. Declare a class implementation an interface requires the imports keyword class actionb import item comparable, its ActionB needs to provide a CompareTo method. The interface is not a class. You cannot instantiate an interface with New. 25. A class has only one super Class, but a class can implement an important interface cloneable26. Interface and callback programming in Java. Programming a common mode is a callback mode, in which mode you can specify a callback object when a specific time occurs Method. ActionListener interface monitors. Similar APIs are: java.swing.joptionpane java.swing.timer java.awt.tookit27. Object Clone: Clone method is Object a protection method, which means that your code cannot be called simple call It .28. Internal Class: One internal class definition is that the reason for defining the other internal class is: 1. An internal class object can access the implementation of the object that creates it, including private data 2. For the same package Other classes, the internal class can hide. 3. Anonymous internal classes can be easily defined. 4. Use the internal classes to write event drivers. 29. Proxy (Proxy): 1. Specify interface requirements All methods of all code 2. Object class (TOSTRING Equals) 30. Data Type: Java is emphasized the type of language, each variable must first declare it all type, and there are 8 basic types in Java. 4 Integer, two are floating-point, one is a character type, which is used in the Unicode encoding characters, Boolean.http://www.scjp.com.cn