Java entry to grasp the basic concept of 30 (job is reposted)
Java White Paper presents us with the Java language of the 11 key
(1) Easy: Java syntax than C + + is relatively simple, the other is in the Java software can run on small machines, and the class library based on its interpretation of the size of the support of about 40 kb, the increase in the basic standards and Threads of memory supported by the need to increase the 125 kb.
(2) Distributed: Java with a very strong TCP / IP protocol family of routines for Java application through the URL through the network to access remote objects, as servlet mechanism, so that a very efficient Java programming Now many major web server support servlet.
(3) OO: Object-oriented design is to focus on the target object and interface, a programming technology. Its object-oriented C + + and there are many different, with multiple inheritance in the treatment and the original Java class model.
(4) robust features: Java security guidelines adopted a model to reduce memory and rewrite the possible collapse of the data.
(5) Safety: Java to design network and distribution system, which has brought new security issues, Java can be used to build anti-virus and anti-attack System. Facts have proved that the virus in Java has done rather well.
(6) neutral architecture: Java compiler generation of the target architecture neutral file format can be implemented on many processors, the compiler to generate bytecode instructions (Javabytecode) to achieve this feature, the byte code can be any machine Executive explained.
(7) portability: Java basic data on the size and type of structure are stringent requirements algorithm portability so good.
(8) Multithreading: Java handling multi-threaded process is very simple, Java to the realization of the multi-threaded operating system or under the thread procedure is completed. Is so multi-threaded server-side Java as a development language pop One of the reasons .
(9) Applet and servlet: in the website called Applet implementation of the procedures, the need to support a lot of Java browser and applet supports dynamic page, and many other languages can not do.
Basic concept
1.OOP relations is the only object of the interface is what computer vendors like her no matter what the internal structure of power, and his relationship can only provide electricity to you on the trip, that is, as long as that can or not and is not how and why all of the procedure is for certain properties and composition of the object, the object of the visit different function call through to completion, all objects through the exchange of Method Invocation by the Packaging object data, a large limits on the rate of increase reuse.
2.OOP the most important category is thinking, is the template is the blueprint from an object class structure, that is, to create this kind of an example (instance).
3. Package: is the combination of data and acts from a bag) and object data users hide the realization process, the data in an object called him examples of fields (instance field).
4. Through expansion of a class to obtain a new category called Inheritance (inheritance), and all are from the class of super-extended Object derived from root, root super-category introductory below.
5. Targeted three main characteristics
— Behavior that can do what this object.
— When the state to impose targeted method targets reflected.
Dentity - and other similar signs distinguish the object of conduct.
Each object is the only indentity and that the interaction between the three.
6. Category of the relationship between:
Use-a: dependence
Has-a: polymerization relations
Is-a: inheritance - Example: A succession of the Class B category, this time not only with Class A Class B method, and its own approach. (Personality exists in common)
7. Constructed using object constructor: The proposed structure, the constructor is a special kind of method, and its structure object initialization.
Example: Data type constructor called Data
New Data ()— construct a new object, and the initialization of the current time.
Data happyday = new Data ()— assigned to an object to a variable happyday so that the object can be repeatedly used here to declare variables and objects to the two variables is different. New value is the return of a quote.
Structural Features: constructor can be 0, one or more parameters
Constructors have the same type and the names of
A class can have more than one constructor
Constructors did not return to duty
Constructors and new operators are always used together.
8. Heavy: When more than one method has the same name but with different parameters, it occurred override. Compiler must choose which method call.
9. Package (package) Java allowed to collect one or more categories together into a group called the package to the organization tasks, divided into many of the standard Java packages. Java.lang java.util java, net, packet is the level of all the java-java in the packet level, and javax.
10. Succession thinking: Allow the category already exists on the basis of constructing a new category, when you inherit an already existing category, then you reuse this type of methods and fields, but you can in the new category Add new methods and fields.
11. Expanded categories: category expansion is fully embodies the relationship-a succession. Form: class (a) extends (base).
12. Polymorphism: java, the object variable is polymorphic. Java and does not support multiple inheritance.
13. Dynamic binding: Call Object mechanism.
(1) compiler statement of the subject of the types and methods.
(2) Method Invocation compiler checks the parameters of type.
(3) Static Binding: If methods types priavte static final compiler will know exactly which way the call.
(4) When operating procedures and the use of dynamic binding to invoke a method, so called virtual machines must be at the object x by the actual type of matching method versions.
(5) dynamic binding: it is very important characteristics, it can become procedures can be expanded without the need to recompile the code has been kept.
14.final categories: to prevent others from your derived class, the new categories, such is not extensible.
15. Call dynamic than static call to the time spent long.
16. Abstract categories: provides one or more methods of the abstract category itself must be defined as abstract.
Example: public abstract string getDescripition
17.Java in each category are from the expansion from the Object class.
18.object equal in category and toString method.
Equal for testing whether an object with another object the same.
ToString return to a representative of the target string, almost every category will override this method, in order to return to the right that the current state.
(ToString method is a very important method)
19. Common programming: Any type of all types of value can be the same type of object variables instead.
20. Array List: ArrayList dynamic arrays list, is a class library, java.uitl defined in the package, can automatically adjust the size of the array.
21.class type of object categories ckass getclass method returns an instance of type, the time of commencement of the methods included in the main categories will be loaded, virtual confidential loading He needs all the categories, each category must be loaded loading it needs category.
22.class category for the preparation of java code can dynamically manipulate the process provided a powerful reflection of the function, this feature is particularly useful for JavaBeans, Java will support the use of reflective VB programmers accustomed to using the tool.
Analysis of the ability to process called reflectors, and to provide this functionality in Java package called Java.lang.reflect reflex mechanism is very powerful.
1. Run-time analysis of capacity.
2. Detectors in the running of the object.
3. Achieve universal array manipulation code.
4. Methods provide object.
The main mechanism for this is a tool rather than the applications and procedures.
Reflex mechanism in the most important part of you is to allow inspection of the structure. Use of the API include:
Java.lang.reflect.Field returned to the field.
Java.reflect.Method return method.
Java.lang.reflect.Constructor return parameters.
Methods indicators: java no means the guide, a way to pass the address of another way to call it back, and interface is a better solution.
23. Interface (Interface) Description categories do not specify how to do, a class can be one or more interface.
24. Interface is not a category, but with the interface requirements of a set of norms.
If the realization of a need to interface two steps:
1. Statement of the need to achieve the specified interface.
2. Interface provides all the methods in the definition.
A statement of the realization of a need to use interface implements keyword
Class actionB implements Comparable actionb need to provide its CompareTo method of interface is not, and should not be an example of a new interface.
25. One of only a super-class, but a class can achieve multiple interfaces. Java as an important interface: Cloneable
26. Interface and callback. Programming model is a popular callback mode, in this mode you can specify a specific time when the event callback object methods.
Example: ActionListener interface monitoring.
Similar API: java.swing.JOptionPane
Java.swing.Timer
Java.awt.Tookit
27. Object clone: clone object is a protection method, which means that your code can not simply call it.
28. Internal categories: one category is the definition of internal definition of the category in another house.
The reasons are:
1. An internal target of the visit to create the realization of its targets, including private data.
2. With a bag in the other categories, can be hidden within the category.
3. Anonymous internal categories can be very convenient to the definition callback.
4. Internal use of the preparation can be very convenient Event-driven procedures.
29. Agency (proxy):
1. Interface requires all designated code
2.object all of the definition of the method (toString equals)
30. Data types: Java is the language of that type, each variable must be affirmed its first all types of java in a total of eight basic types .4 of a cosmetic, is the floating-point-two kinds, one is character is used in the Unicode character encoding, and Boolean.
Tags: basic






