keys()是对键名的遍历、 values()是对键值的遍历 entries()是对键值对的遍历。 for (let index of ['a', 'b'].keys()) { console.log(index); } // 0 // 1 for (let elem of ['a', 'b'].v ...
分类:
其他好文 时间:
2020-03-24 18:40:01
阅读次数:
53
1 #include <stdio.h> 2 #include <stdlib.h> 3 struct slist 4 { 5 int info; 6 struct slist *next; 7 }; 8 int a[8]={35,46,17,80,25,78,66,54}; 9 struct sl ...
分类:
编程语言 时间:
2020-03-24 16:05:46
阅读次数:
108
public class Square { private double side; //成员变量side,类型double public void setSide(double a) { side = a; // 设置正方形的边长,无返回值 } public double getSide() { ...
分类:
编程语言 时间:
2020-03-24 15:46:34
阅读次数:
64
Auto start VM in mac OSX(10.15) 1. Install VirtualBox(6.1.4) 2. Copy file "/Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.pl ...
分类:
系统相关 时间:
2020-03-24 12:39:53
阅读次数:
128
因springboot框架通常用于前后端分离项目,需配置后台允许跨域访问,配置类如下,将该类加入工程中即可。 import org.springframework.context.annotation.Bean; import org.springframework.context.annotati ...
分类:
编程语言 时间:
2020-03-24 11:12:14
阅读次数:
78
在控制台上利用嵌套画出*边的菱形。具体实现代码如下: n = 3;//菱形上半部分的行数 for (int i = 1; i <= n; i++) { for (int j = 1; j <= n - i; j++) { //控制每行最前面的空格 Console.Write(" "); } for ...
分类:
其他好文 时间:
2020-03-24 11:03:21
阅读次数:
51
let a = 2 ** 2 let b = 2 ** 3 console.log(a) // 4 console.log(b) // 8 a **= 2; // 等同于 a = a * a; b **= 3; // 等同于 b = b * b * b; ...
分类:
其他好文 时间:
2020-03-24 10:39:18
阅读次数:
139
public class Demo03 { public static void main(String[] args) { //整数拓展 进制 二进制0b 十进制 八进制0 十六进制0x int i =10; int i2 =010; //八进制0 int i3 =0x11; //十六进制0x 0 ...
分类:
其他好文 时间:
2020-03-24 09:14:23
阅读次数:
64
1. 使用继承的虚函数表: 每个类只有1个虚函数表,当子类继承父类后,子类可以自己改写和新增虚函数,如下图所示: 子类重写 func_1 后,子函数的 func_1 将会有新的逻辑,不会干扰到父类; 子类新增行的 func_4 方法后,父类无法访问到该方法。 如下代码: 1 #include <io ...
分类:
编程语言 时间:
2020-03-24 09:13:07
阅读次数:
87
原:https://www.cnblogs.com/wangjinpeng-study/p/3913892.html 分析问题 在本书前面的章节中,笔者已经介绍过System.Object中的所有方法。而其中有三个方法被设计用来进行对象的比较,它们是: (1)、static bool Referen ...
分类:
其他好文 时间:
2020-03-24 01:03:56
阅读次数:
58