parse用于从一个字符串中解析出json对象,如 1 var str = '{"name":"hanhan","age":"23"}' 2 3 console.log(JSON.parse(str))//Object {name: "hanhan", age: "23"} 注意:单引号写在{}外, ...
分类:
Web程序 时间:
2021-05-24 14:48:46
阅读次数:
0
let dataobj={}1. let arr = Object.keys(dataobj)if(arr.length 0){ console.log('空');}2. if(JSON.stringify(dataobj) "{}"){ console.log('空');}else{ consol ...
分类:
Web程序 时间:
2021-05-24 14:44:36
阅读次数:
0
抽象工厂模式,定义工厂接口,生产某一种类型的配件全部由某一家工厂所提供,解决不同工厂的兼容性问题。 /** * 抽象工厂模式 */ public class AbstratFactoryMethod { public static void main(String[] args) { } } //数 ...
分类:
其他好文 时间:
2021-05-24 14:18:18
阅读次数:
0
/* * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. ...
分类:
编程语言 时间:
2021-05-24 14:13:02
阅读次数:
0
Hello,world Java代码: public class Hello{ public static void main(String[] args){ System.out.print("Hello,world!"); }} 编译: javac Hello.java //编译生成class文 ...
分类:
其他好文 时间:
2021-05-24 14:06:34
阅读次数:
0
countDownLatch这个类使一个线程等待其他线程各自执行完毕后再执行。 public class CountDownLatchDemo { public static void main(String[] args) throws InterruptedException{ /** * * ...
分类:
其他好文 时间:
2021-05-24 13:31:31
阅读次数:
0
简介 使用队列实现队列哈哈. code class MyQueue { public: queue<int> q; public: /** Initialize your data structure here. */ MyQueue() { } /** Push element x to the ...
分类:
其他好文 时间:
2021-05-24 13:17:52
阅读次数:
0
泛型 1 泛型存在的目的 类型参数化,模板化编程,简化编程 2 泛型的原理 java的泛型参数在运行时会进行类型擦除,擦除后就是object,编译器也会转成object进行编译 那么为啥使用泛型呢? 更加安全 更好的可读性 3 泛型的使用 最常用的容器类比如List 泛型类 class Pair2< ...
分类:
编程语言 时间:
2021-05-24 13:12:20
阅读次数:
0
public class Test { public static void main(String[] args) throws InterruptedException { TwoPhaseTermination tpt = new TwoPhaseTermination(); tpt.star ...
分类:
其他好文 时间:
2021-05-24 13:06:08
阅读次数:
0
package cn.rushangw.lesson01;import java.awt.*;public class TestBorderLayout { public static void main(String[] args) { Frame frame = new Frame("TestB ...
分类:
其他好文 时间:
2021-05-24 13:01:24
阅读次数:
0