java design pattern - singleton pattern
Singleton Pattern is one of the simplest design patterns in Java. This type of design pattern is a creation pattern, which provides the best way to create objects. This pattern involves a single class that is responsible for creating its own objects while ensuring that only a single object ...
Added by name1090 on Tue, 08 Mar 2022 03:28:20 +0200
Three basic characteristics of Java object-oriented (encapsulation, inheritance and polymorphism)
The encapsulation of class is equivalent to a black box. You can't see anything in the black box. Inheritance is an important feature of classes. Relatively complex and advanced classes can be inherited from a simple class, which can greatl ...
Added by mikes127 on Tue, 08 Mar 2022 03:02:46 +0200
Delayed tasks are widely used. Typical application scenarios of delayed tasks include automatic cancellation of orders when they timeout; Payment callback retry. Among them, the order overtime cancellation has idempotent property, and there is no need to consider the problem of repeated consumption; Payment callback retry needs to co ...
Why do I need a bag 1. Managing classes through packages is similar to managing blockbusters through folders. 2. The emergence of package provides a multi-layer namespace for classes, that is, the complete class name is "package name + class name".Note: in different packages, we can define classes with the same name; Howev ...
Added by Tentious on Tue, 08 Mar 2022 02:28:11 +0200
What is lombok
Lombok project is a Java library, tool library, which will automatically generate code in the editor or construction tool, so as to make your Java code more concise. Instead of generating get, set and other methods for each variable, it will also generate a fully functional Builder, which has automatically logged variables, and ...
Added by serg4444 on Tue, 08 Mar 2022 02:12:37 +0200
How to alternate the communication between threads?
Threads A and B operate on the same variable numbe=0
* How to alternate the communication between threads?
* Threads A and B operate on the same variable numbe=0
* 1.It is safe when there are only two threads, one more + + and one more
Added by Erestar on Tue, 08 Mar 2022 02:01:46 +0200
Understand Java constants, interface multiple implementations, multiple inheritance, and permission modifiers
1. Constants in Java 2. Multiple implementation of interface 3. Multiple inheritance of interfaces 4. Permission modifier
1. Constants in Java
In the interface, member v ...
Log4j consists of three important components: 1. Priority of log information (Loggers), 2. The output destination of log information (Appenders), 3. Output format of log information (Layouts).
The priority of log information from high to low includes ERROR, WARN, INFO and DEBUG, which are used to specify the importance of ...
Added by roba59 on Tue, 08 Mar 2022 01:23:55 +0200
Deep agent mode
Brief description of agency mode
Selling mobile phones
Xiaomi company has produced mobile phones and wants to sell them for profit.Now there are many Xiaomi homes (agents) that can help Xiaomi sell mobile phones.When selling mobile phones, Xiaomi home can provide services such as invoice, real machine demonstration and explan ...
Added by orlandinho on Tue, 08 Mar 2022 00:41:16 +0200
Maven's role is as follows:
Maven manages all dependent packages in a unified and centralized manner, and programmers do not need to look for them.Corresponding to the common jar s used by third-party components, Maven automatically solves the problems of duplication and conflict.As an open architecture, Maven provides a public interface to fa ...