1. static关键字修饰变量 被static修饰的成员变量叫做静态变量,也叫做类变量,说明这个变量是属于这个类的,而不是属于是对象, 没有被static修饰的成员变量叫做实例变量,说明这个变量是属于某个具体的对象的。 public class Example{ private static in ...
分类:
编程语言 时间:
2020-03-20 21:54:29
阅读次数:
59
饿汉模式 public class Singleton01 { private static final Singleton01 INSTANCE = new Singleton01(); private Singleton01(){} public static Singleton01 getIn ...
分类:
其他好文 时间:
2020-03-18 15:13:02
阅读次数:
55
1、存储结构 private static class Node<E> { E item; //存储元素的值 Node<E> next; //指向下一个元素 Node<E> prev; //指向上一个元素 Node(Node<E> prev, E element, Node<E> next) { t ...
分类:
其他好文 时间:
2020-03-17 14:16:51
阅读次数:
63
一.Object转换成Map,支持下划线转换成map import com.google.common.base.CaseFormat; import com.google.common.base.Converter; class Utils{ private static Converter<St ...
分类:
其他好文 时间:
2020-03-17 14:04:04
阅读次数:
174
public class Tests2020031702 { private static String RANGE = "0123456789"; public static void main(String[] args) { // 1-8位随机组合 for (int len = 1; len ...
分类:
编程语言 时间:
2020-03-17 13:56:51
阅读次数:
57
public class Accout { private static Account account = new Account(); public static void main(String[] args) { ExecutorService executor = Executors.ne ...
分类:
编程语言 时间:
2020-03-14 22:07:05
阅读次数:
70
效果展示 项目代码 客户端 public class Client extends JFrame implements Runnable { private static Socket socket; /** * 主方法 * * @param args */ public static void m ...
分类:
其他好文 时间:
2020-03-14 15:04:43
阅读次数:
55
本文介绍了C#下关于单例的三种实现方法。 最普通的一种: 以下是引用片段: using System; public class Singleton { private static Singleton instance; private Singleton() {} public static S ...
mysql最大连接是有限制的 Google限流框架 Guava /** * 订单限流 */ public class OrderRateLimiterFilter extends ZuulFilter { //每秒产生1000个令牌 private static final RateLimiter ...
分类:
其他好文 时间:
2020-03-10 09:13:55
阅读次数:
58
C# using System; using System.Collections.Generic; using System.Management; namespace ConsoleApp2 { class Win32DiskQuota { private static readonly Man ...