当前位置:网站首页>finalize finalization finally final
finalize finalization finally final
2022-07-03 22:30:00 【Crazy DIU DIU DIU】
finalize
Garbage collector (garbage colector) When you decide to recycle something , Will run the finalize() Method But in Java Unfortunately in China , If there is always enough memory , Then garbage collection may never happen , in other words filalize() May never be implemented , Obviously, it's not reliable to expect it to do the finishing work . that finalize() What is it really about ? Its main purpose is to recycle the memory applied by special channels .Java The program has a garbage collector , So in general, memory problems don't need programmers to worry about . But there is one kind. JNI(Java Native Interface) call non-Java Program (C or C++),finalize() My job is to recycle this part of memory
finally
Java Medium Finally The key is generally related to try Use it together , Before the program enters try After block , Whether the program is terminated due to an exception or by other means ,finally The contents of the block must be executed
finally Block of code and finalize() Method difference
Whether or not an exception is thrown ,finally Code blocks will execute , It is mainly used to release the resources occupied by the application .finalize() The method is Object Class protected Method , It is garbage collected by before the object Java Virtual machine to call
final
- final Literally, it means “ final , The final ”. stay Java It's the same meaning in
- final Can be used to modify variables ( Include class properties 、 Object properties 、 Local variables and formal parameters )、 Method ( Including class methods and object methods ) And the class
- final— Modifier ( keyword ) If a class is declared as final, This means that it can no longer derive new subclasses , Cannot be inherited as a parent class . So a class cannot be declared as abstract Of , It was declared that final Of . Declare a variable or method as final, It can guarantee that they will not be changed in use . Be declared final Must be declared with an initial value , And in the future reference can only read , Do not modify the . Be declared final The same can only be used , Cannot overload
边栏推荐
- Teach you how to run two or more MySQL databases at the same time in one system
- Programming language (1)
- Electronic tube: Literature Research on basic characteristics of 6j1
- QGIS grid processing DEM data reclassification
- How does sentinel, a traffic management artifact, make it easy for business parties to access?
- 2022 G3 boiler water treatment registration examination and G3 boiler water treatment examination papers
- How about agricultural futures?
- [template summary] - binary search tree BST - Basics
- Leetcode: a single element in an ordered array
- Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
猜你喜欢
![[flax high frequency question] leetcode 426 Convert binary search tree to sorted double linked list](/img/db/b992d2b461ca17652518a1511b4947.gif)
[flax high frequency question] leetcode 426 Convert binary search tree to sorted double linked list

Firefox set up proxy server

Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?

Exness: the Central Bank of England will raise interest rates again in March, and inflation is coming

webAssembly

QGIS grid processing DEM data reclassification

Some 5000+ likes, the development notes of a director of cosmic factory, leaked

2 spark environment setup local

Cesium terrain clipping draw polygon clipping
![[actual combat record] record the whole process of the server being attacked (redis vulnerability)](/img/9c/34b916aca2f9270ec4cf4651f0de7e.jpg)
[actual combat record] record the whole process of the server being attacked (redis vulnerability)
随机推荐
6.0 kernel driver character driver
Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
pycuda._ driver. LogicError: explicit_ context_ dependent failed: invalid device context - no currently
Report on the development strategy of China's engineering bidding agency and suggestions for the 14th five year plan Ⓙ 2022 ~ 2028
How to solve win10 black screen with only mouse arrow
WFC900M-Network_ Card/Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-900M-high-power-Mini-PCIe-Wi-Fi-Mod
Market layout planning and latest dynamic analysis report of China's smart public security industry Ⓕ 2022 ~ 2028
2022 G3 boiler water treatment registration examination and G3 boiler water treatment examination papers
The latest analysis of R1 quick opening pressure vessel operation in 2022 and the examination question bank of R1 quick opening pressure vessel operation
China's TPMS industry demand forecast and future development trend analysis report Ⓐ 2022 ~ 2028
Blue Bridge Cup Guoxin Changtian single chip microcomputer -- software environment (II)
(POJ - 2912) rochambau (weighted concurrent search + enumeration)
1 Introduction to spark Foundation
What are the common computer problems and solutions
Codeforces Round #768 (Div. 1)(A-C)
Pointer concept & character pointer & pointer array yyds dry inventory
Yyds dry goods inventory Spring Festival "make" your own fireworks
On my first day at work, this API timeout optimization put me down!
This time, thoroughly understand bidirectional data binding 01
Teach you to easily learn the type of data stored in the database (a must see for getting started with the database)