Eight Writing Methods for Single Case Mode

1. Hungry Han Style (Static Constant) [Available] public class Singleton { private final static Singleton INSTANCE = new Singleton(); private Singleton(){} public static Singleton getInstance(){ return INSTANCE; } } Advant ...

Added by sprinkles on Sun, 18 Aug 2019 09:38:14 +0300

Common API & Exceptions

1. Packaging 1.1 Basic Types of Packaging (Memory) The Role of Basic Types of Packaging Classes The advantage of encapsulating basic data types as objects is that more functional methods can be defined in the objects to manipulate the data. One ...

Added by big_c147 on Thu, 15 Aug 2019 17:22:36 +0300

This is probably the easiest article to implement custom annotations

Definition of annotations Annotations are defined by @interface public @interface Log { } Its keywords and interface definitions are almost the same, except that there is one more. @ Symbols Application of Annotations Annotations can be used simply by adding @xx to the top of a class or method. public class Controller { @Log public voi ...

Added by AStrangerWCandy on Mon, 12 Aug 2019 09:55:26 +0300

Static Agent and Dynamic Agent

Proxy pattern: It is a design pattern that provides additional access to the target object, that is, access to the target object through the proxy object, so as to provide additional functional operations and expand the function of the target object without modifying the original target object. In short ...

Added by KiwiDave on Mon, 12 Aug 2019 08:55:41 +0300

On Functional Programming

This article was first published in A Brief Book of the Purpose of Poufu:https://www.jianshu.com/u/204... 1. Preface One sunny afternoon, I watched the code migrate from day to day and saw this code: Suddenly, I saw code like this: private void getTopicsDiskSizeForSomeBroker(int brokerID, AdminClient admin, Map<String, Long> topicsSi ...

Added by jnutter on Sun, 11 Aug 2019 14:03:24 +0300

After reading this article, we can solve 90% of the memory exception problem in APP.

Why do we optimize memory The. java file we write in Android will eventually be compiled into. class file. After class is loaded by class loader, a meta-information object describing class structure will be formed in JVM. Through this meta-information object, we can know the class structure information (constructor, attribut ...

Added by kelly001 on Wed, 07 Aug 2019 13:24:17 +0300

Static inner classes and Lambda expressions

1. Static internal classes (1) Named static internal classes static class Heart{ { System.out.println("doing...."); } } (2) Anonymous static internal classes class Father { public void eat() { System.out.println("Eat with chopsticks...."); } } /** * External classes */ public class Out ...

Added by DoD on Tue, 06 Aug 2019 13:46:23 +0300

tomcat Log Details

https://www.cnblogs.com/operationhome/p/9680040.html 1 tomcat log details 1.1 tomcat log configuration file The configuration file of tomcat corresponding to the log: / conf/logging.properties under the tomcat directory. tomcat's log level includes: SEVERE (highest level) > WARNING > INFO > CONFIG > FINE > FINER (elaborate) ...

Added by ngoweb on Tue, 06 Aug 2019 05:43:31 +0300

Evolution of Producer and Consumer Problems in Java

Links to the original text: https://dzone.com/articles/th... Authors: Ioan Tinca Translator: liumapp Want to know more about the evolution of Java producer-consumer issues? Let's take a look at this article. We'll deal with this problem with the old method and the new method respectively. The producer-consumer problem is a typical multi-process ...

Added by tmk4php on Mon, 05 Aug 2019 11:12:16 +0300

Redemption from Parallel World

Here comes the divine torture. Why is it called redemption? Discuss a "death question" with you first. If your woman ticket or your wife asks you, "I fell into the water with your mother, who will you save first?" Haha, yes, that's the old voice of China, this torture of your heart's century problem! Are you scared? You c ...

Added by Telemachus on Mon, 05 Aug 2019 07:19:48 +0300