10 2020 档案

摘要:单例设计模式介绍 所谓类的单例设计模式,就是采取一定的方法保证在整个软件系统中,对某个类只能存在一个对象实例,并且该类只提供一个取得其对象实例的方法。 单例模式注意事项和细节说明 1) 单例模式保证了系统内存中该类只存在一个对象,节省了系统资源,对于一些需要频繁创建销毁的对象,使用单例模式可以提高系 阅读全文
posted @ 2020-10-31 22:40 树树树 阅读(140) 评论(0) 推荐(0)
摘要:1 /** 2 * 单例模式-枚举方式 3 */ 4 public class SingletonTest08{ 5 public static void main(String[] args) { 6 Singleton instanceOne = Singleton.INSTANCE; 7 Si 阅读全文
posted @ 2020-10-31 22:25 树树树 阅读(309) 评论(0) 推荐(0)
摘要:1 /** 2 * 单例模式-静态内部类 3 */ 4 public class SingletonTest07{ 5 public static void main(String[] args) { 6 Singleton instanceOne = Singleton.getInstance() 阅读全文
posted @ 2020-10-31 10:20 树树树 阅读(376) 评论(0) 推荐(0)
摘要:1 /** 2 * 单例模式-DoubleCheck 3 */ 4 public class SingletonTest06{ 5 public static void main(String[] args) { 6 Singleton instanceOne = Singleton.getInst 阅读全文
posted @ 2020-10-31 10:04 树树树 阅读(656) 评论(0) 推荐(0)
摘要:1 /** 2 * 单例模式-线程安全懒汉式(同步代码块) 3 */ 4 public class SingletonTest05 { 5 public static void main(String[] args) { 6 Singleton instanceOne = Singleton.get 阅读全文
posted @ 2020-10-31 09:43 树树树 阅读(389) 评论(0) 推荐(0)
摘要:1 /** 2 * 单例模式-线程安全懒汉式 3 */ 4 public class SingletonTest04 { 5 public static void main(String[] args) { 6 Singleton instanceOne = Singleton.getInstanc 阅读全文
posted @ 2020-10-31 09:33 树树树 阅读(232) 评论(0) 推荐(0)
摘要:1 /** 2 * 单例模式-线程不安全懒汉式 3 */ 4 public class SingletonTest03 { 5 public static void main(String[] args) { 6 Singleton instanceOne = Singleton.getInstan 阅读全文
posted @ 2020-10-30 23:20 树树树 阅读(276) 评论(0) 推荐(0)
摘要:1 /** 2 * 单例模式-静态代码块饿汉式 3 */ 4 public class SingletonTest02 { 5 public static void main(String[] args) { 6 Singleton instanceOne = Singleton.getInstan 阅读全文
posted @ 2020-10-30 23:02 树树树 阅读(318) 评论(0) 推荐(0)
摘要:1 /** 2 * 单例模式-静态常量饿汉式 3 */ 4 public class SingletonTest01 { 5 public static void main(String[] args) { 6 Singleton instanceOne = Singleton.getInstanc 阅读全文
posted @ 2020-10-30 22:47 树树树 阅读(203) 评论(0) 推荐(0)
摘要:SpringBoot2默认是关闭PUT和DELETE的,需要在配置问价中加上:spring.mvc.hiddenmethod.filter.enabled=true 阅读全文
posted @ 2020-10-26 11:51 树树树 阅读(1169) 评论(0) 推荐(0)
摘要:查看当前仓库的所有标签: git tag 创建标签: git tag <tagname> 查看标签对应的版本信息: git show <tagname> 删除一个标签: git tag -d <tagname> 历史上某次commit打开一个标签: git tag <tagname> <commit 阅读全文
posted @ 2020-10-12 22:53 树树树 阅读(78) 评论(0) 推荐(0)
摘要:当前分支代码未写完需要换到其他分支工作: git stash 工作完后切换回刚刚未写完的代码分支中获取储藏的信息: git stash apply 查看储藏信息: git stash list 恢复某次储藏信息: git stash apply stash@{1} 恢复储藏出栈: git stash 阅读全文
posted @ 2020-10-12 22:27 树树树 阅读(144) 评论(0) 推荐(0)
摘要:配置SSH KEY 1.查看本地是否配置了SSH KEY : ls -la ~/.ssh 2.生成SSH指纹 ssh-keygen -t rsa -C "你的邮箱" 3.添加SSH到ssh-agent : eval "$(ssh-agent -s)" 4.将用户路径下的.ssh文件中的公钥告诉Git 阅读全文
posted @ 2020-10-12 22:11 树树树 阅读(350) 评论(0) 推荐(0)
摘要:查看当前分支: git branch 创建分支: git branch <分支名> 切换分支: git checkout <分支名> 创建并切换分支: git checkout -b <分支名> 切换回上一个分支: git checkout - 合并分支: git merger --no-ff <分 阅读全文
posted @ 2020-10-12 16:53 树树树 阅读(243) 评论(0) 推荐(0)
摘要:撤销工作区的代码 : git checkout -- test.txt 撤销暂存区的代码:git reset HEAD 撤销本地仓库的代码: git reset --hard <版本号> 退回前两个版本: git reset --hard HEAD^^ 退回后回到前一版本 : git reset - 阅读全文
posted @ 2020-10-12 16:49 树树树 阅读(89) 评论(0) 推荐(0)
摘要:Git基本配置 git config --global user.name="zhangsan" git confit --global user.email="111@qq.com" Git基础操作 初始化仓库 : git init 查看状态:git status add文件到暂存区:git ad 阅读全文
posted @ 2020-10-12 16:45 树树树 阅读(137) 评论(0) 推荐(0)
摘要:1、初始化顺序 1 package com.demo.initialization; 2 3 class Window { 4 Window(int marker) { 5 System.out.println("Window(" + marker + ")"); 6 } 7 } 8 9 /** 1 阅读全文
posted @ 2020-10-07 11:09 树树树 阅读(295) 评论(0) 推荐(0)