码迷,mamicode.com
首页 >  
搜索关键字:static const    ( 70582个结果
CountDownLatch、CyclicBarrier、Semaphore使用例子
都是JUC并发包下的类 CountDownLatch:倒计时,countDown每次减少,await控制达到倒计时要求值 //下自习离开案例,班长必须最后走 public class CountDownLatchDemo { public static void main(String[] args ...
分类:其他好文   时间:2021-04-21 12:21:06    阅读次数:0
设计模式的一些日常记录
内容是看了设计模式之禅,然后自己写个文档总结到一起,便于查看。 单例模式:(程序运行过程中只能有一个类的对象) 单例模式主要是对构造方法进行私有化 private,防止外部通过 new方法 创建实体类。针对该类中的方法尽量使用static修饰,便于访问。 public class Singleton ...
分类:其他好文   时间:2021-04-21 12:14:09    阅读次数:0
JavaScript 中对象解构时指定默认值
待解构字段为原始值 正常情况下, const obj = { a: 1, b: 2, }; const { a, b } = obj; console.log(a, b); // 1 2 当被解构字段缺失时, const obj = { a: 1, }; const { a, b } = obj; ...
分类:编程语言   时间:2021-04-21 12:12:21    阅读次数:0
java8新特性CompletableFuture
public class Main { public static void main(String[] args) throws Exception { // 两个CompletableFuture执行异步查询: CompletableFuture<String> cfQueryFromSina ...
分类:编程语言   时间:2021-04-21 12:05:09    阅读次数:0
30分钟掌握ES6核心内容(上)
ECMAScript 6(以下简称ES6)是JavaScript语言的下一代标准。 最常用的ES6特性 let, const, class, extends, super, arrow functions, template string, destructuring, default, rest ...
分类:其他好文   时间:2021-04-21 12:02:32    阅读次数:0
UDP消息发送
UDP 发短信 : 不需要连接但是需要知道对方的地址 发送消息 //不需要连接服务器 public static void main(String[] args) throws Exception { //1.建立一个socket DatagramSocket datagramSocket = ne ...
分类:其他好文   时间:2021-04-21 11:50:41    阅读次数:0
flutter 获取安卓手机定位 失败(仅安卓、仅定位)
1:使用 插件 geolocator ,官网 https://pub.dev/packages/geolocator 2:按照官网配置,代码照抄 static Future<FlutterLocation> determinePosition() async { bool serviceEnable ...
分类:移动开发   时间:2021-04-21 11:46:27    阅读次数:0
Vuex----Getters
Getter 用于对 Store中的数据进行加工处理形成新的数据。 Getter 不会修改 Store 中的原数据,它只起到一个包装器的作用,将Store中的数据加工后输出出来。 const store = new Vuex.Store({ state:{ count:0 }, getters: { ...
分类:其他好文   时间:2021-04-20 15:30:26    阅读次数:0
Array.prototype.fill 填充值被复用的问题
考察如下示例代码: // 创建二维数组 const arr = Array(2).fill([]); // 操作第一个元素 arr[0].push(1); // 结果是操作了所有数组 console.log(arr); // [ [ 1 ], [ 1 ] ] 和 new 不 new 关系,以下代码问 ...
分类:其他好文   时间:2021-04-20 15:27:38    阅读次数:0
CountDownLatch 和 CyclicBarrier
CountDownLatch 每次当线程调用countDownLatch.countDown()方法时,会对计数器减1,减到0,countDownLatch.await()放行 public class CountDownLatchTest { public static void main(Str ...
分类:其他好文   时间:2021-04-20 15:06:35    阅读次数:0
70582条   上一页 1 ... 58 59 60 61 62 ... 7059 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!