java learning trap 02 Super, static variable, access modifier
1. Static variable
Static variables are shared by all objects in the class, and their values are modified when they are used.
usage method:
Class name. Variable name
Note: static methods can call static members of the same kind, not non static members and methods
Static initial block usage:
Sta ...
Added by wempy on Sun, 08 Mar 2020 15:26:29 +0200
Getting started with Java - advanced tutorial - 04. Serialization
Original address: http://www.work100.net/training/java-serialization.htmlMore tutorials: Beam cloud - free course
serialize
Serial number
Chapter in text
video
1
Summary
-
2
serialized objects
-
3
Deserialize object
-
Please refer to the navigation above for reading
1. overview
Java provides a mechanism of object serialization, in ...
Added by WickedStylis on Sun, 08 Mar 2020 03:41:38 +0200
Monitoring and debugging Java code based on BTrace
Btrace is a dynamic code tracking tool in Java. By writing btrace script, it can dynamically inject tracking code into the byte code of the target application program. By modifying the byte code, it can achieve the purpose of monitoring, debugging and positioning problems, and it is a powerful tool to solve online problems.
Github home page of ...
Added by marty on Thu, 27 Feb 2020 05:24:48 +0200
[Java] object oriented: static static attribute / method / code block
Static modifies the properties or methods of a class
Instance property is the independent memory space (multiple copies) held by each object. If the object is modified unilaterally, other objects will not be affected.
Static attribute, the instance attribute decorated by static, is. Static property i ...
Added by fxchain on Mon, 24 Feb 2020 13:58:35 +0200
1.7 Thread Pool Principle
Why use thread pools
Is not more threads better?
Threads are not only an object in Java, but also a resource of the operating system. Threads take time to create and destroy.Creation time + Destroy time > Execute task time is not a good idea.
Java objects occupy stack memory, and operating sy ...
Added by wannasub on Fri, 14 Feb 2020 04:47:33 +0200
Implementation of five singleton patterns in Java source code
The first play of single example mode -- lazy type
Lazy, this method can only be initialized when getInstance needs to be called, which has the advantage of saving memory space to some extent. But there is also a disadvantage that it is not safe in a multithreaded environment. The code is as follows:
/ ...
Added by monke on Wed, 12 Feb 2020 14:57:09 +0200
Chapter 2 go deep into synchronized keyword
1. introduction
Thread safety is the top priority of concurrent programming, and there are two main causes of concurrent problems.
1. Critical resources exist
2. Multiple threads operate on shared data at the same time
Based on this situation, we will consider a mechanism that when one thread accesses ...
Added by DWilliams on Mon, 20 Jan 2020 11:47:54 +0200
Disruptor Concurrency Framework, Core Component RingBuffer
Introduction to 1.1 Disruptor Concurrency Framework
Martin Fowler wrote an article on his website about the LMAX architecture, in which he described LMAX as a new retail financial trading platform that can generate a large number of transactions with very low latency.This system is built on the JVM pl ...
Added by rwachowiak on Mon, 20 Jan 2020 03:32:15 +0200
Java language learning summary advanced method overload, recursive call
Method overloading
1. Method overloading is also known as: overload
2. When to consider using method overloading?
When the functions are similar, try to keep the method names the same.
[but: when the functions are different / different, try to make the method names different. ]
3. What conditions are ...
Added by axiom82 on Fri, 17 Jan 2020 16:56:05 +0200
JVM exploration: jmap generates memory heap dump snapshot
This series of notes is mainly based on "deep understanding of Java virtual machine: JVM advanced features and best practices version 2", which is the reading notes of this book.
jmap command is used to generate memory heap dump snapshot, which is generally called heapdump or dump file.
In addition to the jmap command, you can also ...
Added by jimdidr on Sat, 11 Jan 2020 17:14:24 +0200