final finally finalize difference stream stream Stream method mvc aop ioc understanding the difference between Collection and Collections Nacos AP, CP

Method to create thread 1. The class inherits Thread and overrides the run() method 2. The class implements the Runnable interface and overrides the run() method (no return value, no exception will be thrown) 3. Implement the Callable interface and implement the call() method (with a return value and an exception will be thrown) To […]

Analysis of the impact of finalize method rewriting on GC

This is my second day participating in the November update challenge. For details, please check: 2021 Last Update Challenge Regarding the finalize method of Object, more than 99% of people may not have paid attention to it in daily development, because business development rarely rewrites the finalize method; most developers’ knowledge of finalize is “interview […]

Java ~ Reference ~ FinalizerHistogram [source code]

Foreword Articles Related series: “Java ~ Reference [Catalogue]” (continuously updated) Related series: “Java ~ Reference ~ FinalizerHistogram【Source Code】” (learning process/more Omissions / for reference only / no longer updated) Related series: “Java ~ Reference ~ FinalizerHistogram [Summary]” (Learning Summary/Latest and Most standard/continuously updated) Related series: “Java ~ Reference ~ FinalizerHistogram【Questions】” (Learning Answers/Continuous Updates ) Involved […]

AbandonedConnectionCleanupThread$ConnectionFinalizerPhantomReference memory overflow

I checked the information on the Internet, and sorted it out here according to my own situation, for your study and reference. Directory 1. Phenomenon 2. Mysql-connector-java source code analysis 3. Solution 3.1. Configure disableAbandonedConnectionCleanup 3.2. Violent solution —– Timing GC 4. What is a phantom reference 5. Is the associated object really recycled? 6. […]

[Java] final, finally, finalize

Article directory final, finally, finalize() final finally finalize() final, finally, finalize() The meanings and functions of final, finally, and finalize are as follows: The final keyword is used to declare an immutable variable, a non-inheritable class, or a non-overridable method. If a variable is modified with final, the value of the variable can no longer […]

Final, finally, finalize of Java keywords

1. final–final modifier Modified attributes: Attributes and local variables modified by final modifiers cannot be reassigned (see Example 1 below), so in order to save memory space, attributes modified by final At the same time, it is modified by static, and the customary writing order is static final. If it is defined as static, it […]

[Solved] The difference between java error and exception try catch finally; throws; final finally finalize

Exception/Error: During the running of the program, some unexpected effects may occur, which will definitely prevent our program from executing according to the instructions; This unexpected effect must be thrown out to tell us; In java there is a defined rule Throwable (throwable) Error error; usually something physical; a problem with the JVM itself; program […]