Java core technology (1): preparations before learning programming

One, the characteristics of the Java language

  • Simplicity
      People want to build a system that can be programmed without esoteric professional training, and that conforms to today's standard practices. Therefore, as a "pure" version of C++, Java has become popular all over the world. Many features that are less used, easily confused, and incomprehensible are eliminated here, and many usable features are preserved.
      Simpler than the Java language is the Visual Programming Language (VB).

  • Object-oriented
      Simply speaking, object-oriented design is a programming technique. It focuses on the object and the interface of the object. To use the carpenter's analogy, an "object-oriented" carpenter always pays attention to the chair he makes, and the second one is the tools used; a "non-object-oriented" carpenter first considers the tools used. In essence, Java's object-oriented capabilities are the same as C++.

  • Network skills
      Java has an extended library of routines for handling TCP/IP protocols like HTTP and FTP. Java applications can open and access objects on the network through URLs, just as convenient as accessing local files.

  • Robustness
      Java puts a lot of effort into early problem detection, later dynamic (runtime) detection, and eliminates the error-prone state.

  • Security
      Java is suitable for network/distributed environments. In order to achieve this goal, a lot of energy has been invested in security. Using Java can build an anti-virus and anti-tampering system.

  • The architecture-neutral
      compiler generates an architecture-neutral object file format, which is a compiled code that can run on many processors as long as there is a Java runtime system. The Java compiler achieves this feature by generating bytecode instructions that have nothing to do with the specific computer architecture. Well-designed bytecode can not only be easily interpreted and executed on any machine, but it can also be quickly translated into local machine code.
      Of course, interpreting bytecode will definitely be much slower than running machine instructions at full speed. But the virtual machine has an option to translate the most frequently used bytecode sequence into machine code. This process is called just-in-time compilation .
      Virtual machines have some other advantages. For example, the virtual machine can detect the behavior of the instruction sequence to enhance its security. Some programs can also quickly generate bytecodes and dynamically enhance the processing capabilities of the running programs.

  • Portability
      In Java, data types have a fixed size, which eliminates the main headache of code migration. Binary data is stored and transmitted in a fixed format, eliminating the problem of byte order. The string is stored in a standard Unicode format.

  • The interpreted
      Java interpreter can execute Java bytecode on any machine where the interpreter is ported.

  • The high-performance
      just -in- time compiler allows bytecode to be quickly translated (at runtime) into the machine code of the specific CPU running the application, and the code can be optimized.

  • Multi-threading and
      multi-threading can bring better interactive response and real-time behavior. On different machines, the code that just calls multithreading is exactly the same; Java gives the implementation of multithreading to the underlying operating system or thread library to complete.

  • Dynamic
      things from many perspectives, Java bit more dynamic compared to C or C ++. It can adapt to the evolving environment. New methods and instance variables can be added freely in the library without any impact on the client.

2. The development of APPLET and Java language

1.APPLET

  Applet is a small application program written in the Java programming language. The program can be included in an HTML (an application of the Standard Universal Markup Language) page in roughly the same way as the image is included in the page.
  The HTML file code of the web page containing the Applet has a pair of tags in the middle. When a Java-enabled web browser encounters this pair of tags, it will download the corresponding applet code and execute the Applet on the local computer.

2. The development of Java language

Insert picture description here

Three, Java programming environment

Insert picture description here

1.Java Development Toolbox JDK

  • Download link: www.oracle.com/technetwork/java/javase/downloads
  • Set environment variables: The so-called execution path refers to the directory list where the operating system searches for local executable files. Different operating systems have different operation steps.
  • Test: Enter javac -version in the command window and press enter to check whether the jdk is installed successfully.
  • Install library source files and documentation

2. Choose a development environment

  Eclipse, IDEA, etc. are all available.

Guess you like

Origin blog.csdn.net/Tracycoder/article/details/112168632