Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the four core concepts in java?

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "what are the four core concepts in java". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn "what are the four core concepts in java"?

1.Java virtual machine

The main task of the Java virtual machine is to install the class file and execute the bytecode in it. The Java virtual machine contains a class loader that loads class files from programs and API. In Java API, only those classes that are needed for program execution are loaded. The bytecode is executed by the execution engine. The implementation of the execution engine may be very different in different Java virtual machines. In a virtual machine implemented by software, the simplest execution engine is to interpret bytecode at once.

The other kind of execution engine is faster, but also more memory-consuming, called just-in-time compiler (just-in-time compiler). In this case, the bytecode executed * * times will be compiled into local machine code. The compiled native machine code is cached and can be reused when the method is called later.

The third execution engine is the adaptive optimizer. In this approach, the virtual machine interprets the bytecode at the beginning, but monitors the activity of the running program and records the code snippets that are used most frequently. When the program is running, the virtual machine compiles only the most active code into native code, and the rest of the code is retained as bytecode because it is not used very frequently-and the virtual machine continues to interpret them.

An adaptive optimizer allows the Java virtual machine to execute optimized native code 80% to 90% of the time, while compiling only 10% to 20% of the performance-impacting code.

two。 Architecture of class loader

A Java application can use two types of loaders: the bootstrap class loader and the user-defined class loader. Starting the classloader (which is part of the system) is part of the Java virtual machine implementation. Boot class loaders usually use some default way to load classes from the local disk, including the Java API class (the boot class loader is also known as the original class loader, system class loader, or default class loader).

Java applications can install user-defined class loaders at run time, which can load classes in a custom way. For example, download class files from the network. Although boot class loaders are an essential part of virtual machine implementation, while user-defined class loaders are not, user-defined class loaders can be written in Java, can be compiled into class files, can be loaded by virtual machines, and can be instantiated like other objects.

3.Java class file

Java class files mainly make Java more suitable for the network in terms of platform independence and network mobility. Its task in terms of platform independence is to provide Java programs with binary services independent of the underlying host platform. This approach breaks with the tradition followed by languages such as C or C++, where programs written in these traditional languages are usually compiled first and then connected into separate binaries that specifically support specific hardware platforms and operating systems.

In general, binary executables on one platform do not work on other platforms. Java class files can be run on any hardware platform and operating system that supports Java virtual machines.

4.Java API

Java API makes Java adapt to network applications by supporting platform independence and security. Java API is a collection of runtime libraries that provide a standard set of methods for accessing host system resources. The Java API class file used by the class file of the virtual machine loader when running the Java program. All loaded class files (including those extracted from applications and Java API) and all loaded dynamic libraries (including local methods) make up the entire program running on the Java virtual machine.

At this point, I believe you have a deeper understanding of "what are the four core concepts in java". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report