If you want to learn Java, you must read it. If you do not read it, you will regret it.

Source: Internet
Author: User

If you want to learn Java, you must read it. If you do not read it, you will regret it.
What is Java?

Java is an object-oriented programming language. It not only absorbs the advantages of the C ++ language, but also abandons the many inheritance and pointer concepts that are hard to understand in C ++, therefore, the Java language is powerful and easy to use. Java, as a representative of the static object-oriented programming language, implements object-oriented theory and allows programmers to perform complex programming in an elegant way of thinking.

What can I do when I learn java?

Java features simplicity, object-oriented, distributed, robustness, security, platform independence and portability, multithreading, and dynamic nature. Java can write desktop applications, Web applications, distributed systems, and embedded system applications.

Java2 version Division

 

Main features of Java Java The language is simple:

The syntax of Java is very similar to that of C and C ++, making it easy for most programmers to learn and use it. On the other hand, Java discards the rarely used, hard-to-understand, and confusing features in C ++, such as operator overloading, multi-inheritance, and automatic forced type conversion. In particular, Java uses references instead of pointers. And provides automatic waste collection, so that programmers do not have to worry about memory management.

Java The language is object-oriented:

The Java language provides object-oriented features such as classes, interfaces, and inheritance. For the sake of simplicity, only single inheritance between classes is supported, but multi inheritance between interfaces is supported, it also supports the implementation mechanism between classes and interfaces (the keyword is implements ). Java supports dynamic binding, while C ++ supports dynamic binding only for virtual functions. In short, Java is a pure object-oriented programming language.

Java The language is distributed:

Java supports Internet application development. There is a Network Application Programming Interface (Java net) in the Basic java application programming interface. It provides a class library for network application programming, including URL, URLConnection, Socket, and ServerSocket. Java's RMI (Remote Method activation) mechanism is also an important means of developing distributed applications.

Java The language is robust:

Java's strong type mechanism, exception handling, and automatic garbage collection are important guarantees for Java program robustness. Discarding pointers is a wise choice for Java. Java's security check mechanism makes Java more robust.

Java The language is secure:

Java is usually used in network environments. Therefore, Java provides a security mechanism to prevent malicious code attacks. In addition to many security features of the Java language, Java has a security mechanism (class ClassLoader) for classes downloaded over the network ), for example, if you allocate different namespaces to avoid replacing local cognominal classes and byte code checks, and provide security management mechanisms (class SecurityManager) for Java applications to set security guards.

Java The language is architecture neutral:

Java programs (Files suffixed with java) are compiled as system-neutral bytecode format (Files suffixed with class) on the Java platform ), then it can run in any system implementing this Java platform. This approach is suitable for distribution of heterogeneous network environments and software.

Java The language is portable:

This portability comes from the Neutral architecture. In addition, Java strictly specifies the length of each basic data type. The Java system itself is also highly portable. the Java compiler is implemented in Java and the Java Runtime Environment is implemented in ansi c.

Java The language is interpreted:

As mentioned above, Java programs are compiled into bytecode on the Java platform and can then run in any system implementing the Java platform. During runtime, the Java interpreter on the Java platform interprets and executes these bytecode, And the classes required during execution are loaded into the runtime environment during the connection stage.

Java High performance:

Java is indeed of high performance compared with those of the interpreted high-level scripting language. In fact, Java's running speed is approaching C ++ with the development of JIT (Just-In-Time) compiler technology.

Java The language is multi-threaded:

In Java, a Thread is a special object, which must be created by the Thread class or its subclasses. There are usually two ways to create a Thread: first, use the constructor of Thread (Runnable) to package an object that implements the Runnable interface into a Thread. Second, the subclass is derived from the Thread class and the run method is rewritten. The object created using this subclass is a Thread. It is worth noting that the Thread class has implemented the Runnable interface. Therefore, any Thread has its run method, and the run method contains the code to be run by the Thread. Thread activities are controlled by a set of methods. The Java language supports simultaneous execution of multiple threads and provides a synchronization mechanism between multiple threads (the keyword is synchronized ).

Java The language is dynamic:

One of the goals of the Java language is to adapt to the dynamic environment. The classes required by the Java program can be dynamically loaded into the runtime environment, or the required classes can be loaded through the network. This is also conducive to software upgrades. In addition, the class in Java has a runtime representation that can check the runtime type.

 

Java program Problems
  • JavaVirtual MachineJava Virtual Machine (JVM) is an abstract computer that runs all Java programs. It is the runtime environment of the Java language and one of the most attractive features of Java.

Java virtual machine consists of five parts:Composition: Command System, register, stack, storage area, and shard collection area.

Function: Explain and execute the bytecode generated after Java program Compilation

  • Java APIIs a collection of predefined software components provided by the Java system. They provide many common functions that can be called by programmers. The rich APIs provide great convenience for programmers, but they are also difficult to learn.

Latest online Java API Web site: https://docs.oracle.com/javase/9/docs/api/overview-summary.html

 

  Java Program type Java Application) Java Java Web)Java Development Environment
JDK/J2SDK (Java Developer Kit)It is a development environment used to build applications, applets, and components released on the Java platform. This includes the Java compiler, JVM, a large number of Java tools, and Java basic APIs which contain Java class libraries and Java language specifications. At the same time, any improvements to the Java language should be added, released as a later version. To become a programmer, JDK is the most basic tool.
JDK latest 9.0.1,: http://www.oracle.com/technetwork/java/javase/downloads/index.html
 JavaIntegrated Development Environment (IDE ):Recommended use of Eclipse, http://www.eclipse.org/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.