Dynamic Capacity Expansion Mechanism of ArrayList
ArrayList has three initialization methods
public ArrayList()
public ArrayList(int initialCapacity)
public ArrayList(Collection<? extends E> c)
The first parametric construction method
/**
* Constructs an empty list with an initial capacity of ten.
*/
public ArrayList() {
...
Added by mevasquez on Wed, 07 Aug 2019 06:32:03 +0300
DockerFile files and commands for building Docker images in Linux-SpringBook
DockerFile file
Note: Mode 1 is the Docker File file that I used when I built the Docker image in SpringBook, which can be modified by myself.
1. Building a SpringBook Project Mirror Based on the Existing JDK Mirror
#Setting up JDK image
FROM openjdk:8-jdk-slim
VOLUME /tmp
MAINTAINER sunhui
#ti ...
Added by 11Tami on Tue, 06 Aug 2019 13:38:15 +0300
Install Java JDK 8 in CentOS 7/6.5/6.4
Original Link: http://www.cnblogs.com/cgfree/p/5397890.html
This tutorial describes how to install and CentOS Configure the latest on servers 7, 6.5, and 6.4 Oracle JavaJDK for.Although these steps should also apply to other RPM-based d ...
Added by hongco on Mon, 05 Aug 2019 23:25:26 +0300
A Simple Factory Model with Detailed Design Patterns
1. Definition:
An instance of which product class is created is determined by a factory object.
2. Types:
Creative, but not GOF23 design pattern
3. Use scenarios:
The factory class is responsible for creating fewer objects. The client (application layer) only knows the parameters that are passed into the factory class, and does not care about h ...
Added by arctushar on Thu, 01 Aug 2019 12:41:54 +0300
Learning Java Architecture Design Patterns from the Beginning 3: Prototype Patterns
Prototype pattern - A prototype instance specifies the type of object created and creates new objects by copying these prototypes. The caller does not need to know any creation details and does not call the constructor! It belongs to the creation mode.
It does not create other objects by new, but by using existing objects in memory as template ...
Added by dimitris on Mon, 29 Jul 2019 15:43:56 +0300
Common classes in java
Method Rewriting (Supplementary)
In case of rewriting:
Inheritance
Method Name Same
The list of parameters should be identical (order, number, type)
When the return value type is a reference type, the return value type of the subclass is exactly the same when it is less than or equal to the basic typ ...
Added by wiccan8888 on Thu, 25 Jul 2019 08:10:55 +0300
Reading Map Collection in One Minute
Map collection
1.1. Overview
In real life, we often see such a set: IP address and host name, ID number and individual, system user name and system user object, etc. This one-to-one correspondence is called mapping. Java provides a special collection class to store the object of this object relatio ...
Added by r00tk1LL on Mon, 22 Jul 2019 11:14:42 +0300
AOP, the Core Technology of Spring Framework Documents
AOP
AOP provides a new way to think about program structure to supplement OOP. The key of module in OOP is class, while the key of module in AOP is aspect. Aspects support modularization across multiple types and objects, such as transaction management.
AOP concept
Aspect -- The process of performing notification operations at pointcuts (class ...
Added by Chris 96 WS6 on Mon, 22 Jul 2019 06:39:30 +0300
Java -- Object class and wrapper class
Object class
Object is the parent of all classes, that is, all classes can be received with Object.
Except for Object classes, all classes have inheritance relationships.Obtaining object information
Getting object information, using the toString method
package obj.exe.bit;
class Person{
private String ...
Added by Kold on Sat, 20 Jul 2019 14:49:51 +0300
The underlying implementation principle of HashMap
Summary
The following is based on JDK 1.8
data structure
HashMap is actually an "array + linked list" data structure.
In the put operation, the subscript of the array is found by the internal definition algorithm, and the data is directly put into the element of the array. If the element o ...
Added by Dixen on Fri, 19 Jul 2019 12:57:49 +0300