Java Understanding Observer Patterns

Foreword: Recently, in learning RxJava, RxJava has been extended on the basis of observer mode. This article takes you to understand the observer mode. What is the Observer Model The observer pattern is the object's behavior pattern, also known as Publish/Subscribe, Model/View, Source/Listener or Dependents. When there is a one ...

Posted by engelsol on Thu, 01 Aug 2019 01:27:38 -0700

leetcode concurrent problem-solving report JAVA version

Print in OrderSuppose we have a class: public class Foo { public void first() { print("first"); } public void second() { print("second"); } public void third() { print("third"); } } The same instance of Foo will be passed to three different threads. Thread A will call first(), thread B will call second(), and thread C will call third(). ...

Posted by Headwaters on Wed, 31 Jul 2019 19:29:43 -0700

C/S model: TCP, UDP build client and server (BIO implementation)

socket programming is provided in Java to build client and server side TCP Steps to build the server side: (1) bind: Bind port number (2) listen: listen for client connection requests (3) accept: an instance of returning a connection to the client (4) read/write: read/write operations, i.e., interactio ...

Posted by davex on Wed, 31 Jul 2019 19:00:32 -0700

HashMap for Java Containers is very detailed - most frequently used, but do you really understand?

Preface Learning record Learning record Time: week 3 SMART sub-goal: Java container Recorded in learning Java container knowledge points, about HashMap needs to focus on recorded knowledge points. Overview of knowledge points: I. hashCode() 2. HashMap underlying implementation brief introduction storage structure Important attributes Add ...

Posted by steanders on Mon, 29 Jul 2019 21:06:25 -0700

Docker Beginner Practice

Collect all the information on the Internet, organize some steps, personal records, memorandums! Install Docker centos7 installs docker Refer to https://www.runoob.com/docker/centos-docker-install.html and follow these steps for installation Remove the old version yum remove docker \ docker-cl ...

Posted by iacataca on Sat, 27 Jul 2019 03:00:51 -0700

Java Concurrent Programming Notes: Excutors Framework for J.U.C: ThreadPool Executor

Introduction to ThreadPool Executor stay J.U.C. Excutors Framework: Excutors Framework Design Concept ThreadPool Executor has been briefly introduced in this chapter. Through the Executors factory, users can create the executor objects they need. ThreadPool Executor is an executor, or thread pool, that implements the ExecutorService interface ...

Posted by nagasea on Wed, 24 Jul 2019 19:58:54 -0700

switch...case, if...else, for and while loops, do...while statements, double for loops

Articles Catalogue switch...case ** Summary: ** if...else Note: Loop statements: for and while loops for loop statement while loop statement do...while statement Double for cycle switch...case Basic structure: switch(key) { case value : break; default : break; } P ...

Posted by JohnnyBlaze on Wed, 24 Jul 2019 04:23:26 -0700

Java Concurrent Programming Notes: J.U.C. Excutors Framework: Excutors Framework Design Concept

Introduction of executors framework juc-executors framework is the most complex framework of class/interface relationship in the whole J.U.C package. The premise of truly understanding executors framework is to clarify the relationship between each module, build a high house, and thoroughly understand the functions and design ideas of each mod ...

Posted by jbrave on Tue, 23 Jul 2019 20:58:33 -0700

GSON Source LinkedTreeMap Learning

In the process of learning GSON, LinkedTreeMap, the basic data type of GSON, was discovered, so learning was started. private final LinkedTreeMap<String, JsonElement> members = new LinkedTreeMap<String, JsonElement>(); LinkedTreeMap, everything is so familiar. In jdk, there are LinkedMap, TreeMap and TreeMap. What is ...

Posted by Luvac Zantor on Tue, 23 Jul 2019 08:41:08 -0700

JAVA serialization and deserialization

1. Why do we need serialization and deserialization We know that when two processes communicate remotely, they can send each other various types of data, including text, pictures, audio, video and so on, which will be transmitted on the network in the form of binary sequences. So when two Java proce ...

Posted by KCKTechs on Tue, 23 Jul 2019 06:20:01 -0700