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 is the basic conceptual knowledge of Java?

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

Share

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

Editor to share with you what the basic concepts of Java knowledge, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

A brief description of the whole process of Java code from writing to running

Write code: implement the requirements through code

Compile to bytecode file: compile the encoded source program into a bytecode file .class

Class loading (classloader): to find or load classes needed to run a program

Bytecode check (bytecode verifier): verifies class code to ensure security, such as object types and object access permissions

Interprter: the machine does not know the bytecode file and needs to be interpreted by the interpreter before it can run

Run: finally, the code can be run in the running environment

A brief introduction to the working Mechanism of the Virtual Machine and the recovery Mechanism

Garbage collection means that JVM collects the allocated and unused memory space through some garbage collection algorithms to improve the running efficiency of the program and prevent memory leaks. Because it takes time to reclaim memory space, frequent garbage collection will affect the running efficiency of the program, so when there are unreferenced objects, JVM will not collect them immediately, but choose to collect them at the right time. So using system.gc () in the program will not immediately carry out garbage collection, but will inform JVM that garbage collection is needed.

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

A brief introduction of java Security Mechanism

Class loader structure (class loader): loading and finding classes needed for program execution

Class File Checker (the class file verifier): the virtual machine verifies the integrity of the loaded bytecode file and verifies it four times

The first trip: check the file structure, such as whether the file conforms to the abridged structure of the JavaClass file

The second trip: semantic checking of type data, such as checking whether the final class is quilted, etc.

The third round: bytecode verification to ensure that the Operand stack always contains the correct value and the correct type.

The fourth round: verification of symbol references, because the Java program is dynamically linked, the Class file inspector must check the compatibility of cross-referenced classes during the fourth scan.

Zhengzhou Infertility Hospital: http://jbk.39.net/yiyuanzaixian/zztjyy/

Some security features built into JVM:

A) Type-safe reference conversion

B) automatic garbage collection mechanism

C) null reference check

D) structured memory access

Java Manager and java api

A brief introduction to the three object-oriented characteristics of java

Encapsulation: privatize attributes for use only within the class, providing public methods for external use, like the common java bean, where both priavte,set and get methods are common.

Why not directly set the property of the class to public for external use, because if you use it directly, you cannot process the property and get it again, or if some common properties are read-only and cannot be modified, you cannot directly set the property to be public for external use.

Inheritance: subclasses inherit the methods and properties of the parent class, and can override the parent method or extend the new method. Java is a single inheritance language, which is a subclass and can inherit only one parent class. The inheritance of java improves the program reusability and expansibility of java.

Polymorphism: java objects of different classes can respond to the same function call, that is, function calls can behave differently according to the sending object. Java polymorphism is divided into run-time polymorphism and compile-time polymorphism. Compile-time polymorphism refers to the overloading of methods, that is, you can determine which method to use at compile time. Run-time polymorphism means that Java decides which method to call according to the instance type of the calling method at run time. So polymorphism means that on the basis of inheritance, the reference to the parent class can point to the subclass object and call the subclass rewriting method, that is, the subclass is transformed upward into the parent class, but the specific extension methods of the subclass cannot be used. you can call unique methods by forcing type conversions.

Method by value and by reference

Pass by value: if the parameter type of the method is not a reference type, it is passed by value, so when the method is called, the parameter copies the argument for operation and does not change the value of the argument.

Pass by reference: if the formal parameter type of a method is a reference type, it is passed by reference, so when the method is called, the address of the argument is passed, and the operation of the parameter will change the value of the argument.

These are all the contents of the article "what are the basic Concepts of Java?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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