Java language features series of interview questions knowledge

Summary of characteristics:

Java language style much like the C language and C ++ language, is a pure object-oriented language, it inherits the C ++ language core object-oriented technology, but abandoned some of the shortcomings of C ++, such as error-prone as well as multi-pointer inheritance, etc., but also increase the garbage collection mechanism, freed memory space is not being used to solve the trouble of managing memory space.

Java language is a distributed object-oriented language, an object-oriented, platform independence, simplicity, interpreted, multithreading, security and many other features, the following were introduced one by one these characteristics.

1. Object Oriented

    Java is an object-oriented language, its object classes, objects, inheritance, encapsulation, polymorphism, interfaces are well supported, and other packages. For simplicity, Java supports only single inheritance between classes, but you can use the interface to achieve multiple inheritance. Using the Java language development program, we need a program object-oriented design thinking and writing code.

2. platform independence

    Platform-independent concrete manifestation of that, Java is "write once (Write Once, Run any Where)" language, so a program written in the Java language has good portability, and ensure this is precisely Java virtual machine mechanism. Following the introduction of the virtual machine, Java language running on different platforms without recompiling.

    Java language using the Java Virtual Machine shielding mechanisms relevant information specific platform, making the Java language compiler generates object code only of the program on the virtual machine, it can run without modification on multiple platforms.

3. Simplicity

    The syntax for C and C ++ language is very similar to the Java language that many programmers very easy to learn. For Java, it abandoned many of the features in C ++ difficult to understand, such as operator overloading and multiple inheritance, etc., but the Java language does not use pointers, adding garbage collection, programmers need to solve the problem of memory management, make programming easier.

4. interpreted

    Java programs in the Java platform runtime will be compiled into bytecode files can then be run on the operating system Java environment. When run files, Java interpreter to interpret the byte code execution, execution needs to add the class is loaded into the execution environment in the connection phase.

5. Multithreading

    Java language is multi-threaded, which is also a major feature of the Java language, it must be created by the Thread class and its subclasses. Java support multiple threads execute simultaneously, and provides a synchronization mechanism between multiple threads. Any thread has its own run () method, the method to execute written on the run () method in vivo.

6. Distributed

    Java language to support the development of Internet applications in Java's basic application programming interfaces there is a network application programming interface, which provides network application programming libraries, including the URL, URLConnection, Socket and so on. RIM is also an important mechanism of Java distributed application development tools.

7. robustness

    Java's strong typing, exception handling, garbage collection, etc. are important to ensure the robustness of Java. Discard pointer is Java's a big step forward. In addition, Java's exception mechanism is also reflected in the robustness of a major.

8. High Performance

    Although Java is interpreted, but it still has a very high performance on some specific CPU, Java byte code can be quickly converted into machine code execution. Java byte code format is designed for the conversion of machine code, the actual conversion becoming quite simple, automatic register allocation and some optimization compiler may generate byte code quality code. With the improvement and "instant compile" Java Virtual Machine - JIT (Just in Time) development, Java running speed is higher and higher.

9. Security

    Java is often used in a network environment, for which, Java provides a safety mechanism to prevent malicious code. In addition to the Java language has many security features outside, Java also adds a security mechanism through the network to download the class, assign different namespaces to prevent displacement of the native class of the same name, and includes security management mechanism.

Many features of the Java language so that it occupies a large market share in many programming languages, Java language support for object and powerful API makes programming easier and faster, greatly reduce the development costs of the program. Java's "write once, execute everywhere" It is a big advantage it has attracted many businesses and programmers.

Dry notes more attention to micro-channel public number: the old nine school

Guess you like

Origin www.cnblogs.com/ljxt/p/11612930.html