Java basic conceptual knowledge

Description of the whole process from writing Java code to run

  1. Write code: the demand by code implementation

  2. Compiled into byte code files: the source encoded .class files compiled into bytecode

  3. Class loader (classloader): Looking class or load required to run program

  4. Byte parity code (bytecode verifier): class code verification, to ensure the security, such as object type, object access

  5. Interpretation (interprter): The machine does not know bytecode files, to run the interpreter needs to be explained

  6. Run: The final code can be run in a runtime environment

Working mechanism outlined virtual machine

[Description of Java code with the whole process from run to run]

Brief collection mechanism

Garbage collection refers to the JVM garbage collection algorithm through some recovered memory space allocated out and not being used to improve process efficiency, prevent memory leaks. Since the recovery of memory space takes time, frequently carry out garbage collection will affect the operational efficiency of the program, so when the object appears unreferenced, JVM will not be recovered immediately, choosing instead to be recycled at the right time. So use in the program system.gc () do not immediately garbage collection, but need to notify the JVM garbage collection

Zhengzhou professional treatment of infertility hospital: http: //byby.zztjyy.com/

Brief java security

  1. Class loader structure (class loader): class loading and execution program looking for the desired

  2. File Checker class (the class file verifier): bytecode file integrity check of a virtual machine loading, four times for verification by 
    the first pass: check the file structure, such as checking whether the file conforms to the structure of the section of the document JavaClass 
    second pass: semantic checker type of data, such as checking final class there quilts etc. 
    third Run: bytecode verification, to ensure that the operand stack always contains the correct value and the correct type. 
    Fourth Run: verification of symbolic references, since the Java program is dynamically linked, so Class File Checker fourth scanning is performed, each must check the compatibility between the class reference.

  3. Zhengzhou infertility hospital: http: //jbk.39.net/yiyuanzaixian/zztjyy/

  4. Some safety features built into the JVM: 
    A) conversion type reference security 
    b) automatic garbage collection 
    c) null reference check 
    d) structure of the memory access

  5. Java Manager and java api

DESCRIPTION java object-oriented three characteristics

  1. Packaging: The property privatization internal use only class to provide public methods of external use, like common java bean, attributes are priavte, set and get methods are shared. 
    Why not the kind of property to the public for external use, because of the direct use of the words, unable to attribute the appropriate treatment and then obtaining, or some common attributes read-only, can not be modified, it can not directly attribute to the public for external use .

  2. Inheritance: A subclass inherits the methods and properties of the parent class and the parent class or a new way to override the method can be extended. java is a single inheritance language, is a subclass can only inherit from a parent class. java inheritance is a java program to improve the reusability and extensibility

  3. Polymorphism: refers to different types of java objects may respond to the same function call, the function call is transmitted according to different objects and different behavior. java runtime polymorphism is divided into multi-state and multi-state compilation, polymorphism refers to the overloaded methods that can determine which method to use at compile time compile time, run-time polymorphism means call the method in accordance with a Java runtime examples of types to determine which method call. So polymorphism means on the basis of inheritance, a reference to the parent class can point to a subclass of objects, methods, subclasses override the call is a subclass of the transition up to the parent, but the subclass-specific extension methods can not be used, can by casts unique method to achieve call 

Method and passed by value is passed by reference

  • Passed by value: Type parameter method is not a reference type, it is passed by value, then this method is invoked, the parameter argument for a copy operation does not change the value of the argument.

  • Passed by reference: Method of parameter type is a reference type, it is passed by reference, then when the method is called, passing the address of the argument, the calculation parameter change the value of the argument.

http://dalian.huodong.dqccc.com/exposition/detail-2237291.html

Guess you like

Origin blog.51cto.com/14510351/2442087