单例模式 初识: 单例模式(Singleton Pattern)是 Java 中最简单的设计模式之一。 这种类型的设计模式属于创建型模式,它提供了一种创建对象的最佳方式。 这种模式涉及到一个单一的类,该类负责创建自己的对象,同时确保只有单个对象被创建。 这个类提供了一种访问其唯一的对象的方式,可以直 ...
分类:
编程语言 时间:
2020-10-29 09:37:07
阅读次数:
26
@Test public void b() { int[] arr = new int[]{1, 2, 3, 4, 5, 4, 3, 2, 1}; int start = 0; int end = arr.length - 1; while (start <= end) { if (arr[star ...
分类:
编程语言 时间:
2020-10-29 09:20:36
阅读次数:
23
默认路径/usr/local 指定目录/server升级(如果不明白如何安装的点击https://www.cnblogs.com/chenlifan/p/13849099.html) 1.创建一个old库 #启动数据库 创建一个数据库 查看 [root@db02 ~]# systemctl star ...
分类:
数据库 时间:
2020-10-27 11:42:36
阅读次数:
29
添加引用: ThoughtWorks.QRCode.dll System.Drawing using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Mi ...
@Slf4j public class ClassLoaderDeadLockDemo { // 定义一个常量 ,在类加载时期写入到 constant-pool中 public static final Object OBJECT = new Object(); static { log.info( ...
分类:
编程语言 时间:
2020-10-27 11:00:34
阅读次数:
28
ArrayList<ResultTime> list = new ArrayList<>(); //格式化时间 DateTimeFormatter md = DateTimeFormatter.ofPattern("MM-dd"); DateTimeFormatter mh = DateTimeFo ...
分类:
其他好文 时间:
2020-10-27 10:54:31
阅读次数:
21
https://blog.csdn.net/u011239989/article/details/72863333 expain ref: 表示查询所使用的访问类型,type的值主要有八种,该值表示查询的sql语句好坏,从最好到最差依次为:system>const>eq_ref>ref>range> ...
分类:
数据库 时间:
2020-10-26 11:53:51
阅读次数:
28
MyBatis注解之动态SQL 准备SqlProvider 新增CategoryDynaSqlProvider,提供CRUD对应的SQL语句。 点击查看完整CategoryDynaSqlProvider package com.nyf.providers; import org.apache.iba ...
分类:
数据库 时间:
2020-10-26 11:29:09
阅读次数:
38
HelloWorld 新建一个文件夹 存放代码 新建一个java文件 文件后缀名为.java Hello.java 编写代码 public class Hello{ public static void main(String[] args){ System.out.print("Hello, wo ...
分类:
编程语言 时间:
2020-10-26 11:14:23
阅读次数:
19
1.他们是Throwable的两个平行类。Expection是所有异常类的祖先,而Error是错误类的祖先。 ①Error不是程序需要捕获和处理的,发生时程序将会停止。 ②Exception有许多子类,都是按照包的形式组织的,程序需要应对这些异常对象进行相应的处理。 2. //隐式声明抛出1 imp ...
分类:
编程语言 时间:
2020-10-26 11:08:15
阅读次数:
27