泛型方法的定义 /** * 泛型参数的无返回值方法 * * 1、public 与 返回值中间<T>非常重要,可以理解为声明此方法为泛型方法。 * 2、只有声明了<T>的方法才是泛型方法,泛型类中的使用了泛型的成员方法并不是泛型方法。 * 3、<T>表明该方法将使用泛型类型T,此时才可以在方法中使用泛 ...
分类:
其他好文 时间:
2021-04-20 14:34:49
阅读次数:
0
#include <iostream> //预处理器编译指令#include int main(void) //函数头 { //函数体开始{ using namespace std; //编译指令 int apple; //声明整数变量 apple = 25; //赋值变量 cout << "我有" ...
分类:
编程语言 时间:
2021-04-20 14:29:02
阅读次数:
0
写一个符合 Promise A+ 规范的 Promise 类型定义 // MyPromise.ts type resType = (value?: any) => void; type rejType = (reason?: any) => void; type executorType = (re ...
分类:
其他好文 时间:
2021-04-20 14:26:37
阅读次数:
0
连续写入 void i2c_write( unsigned char *strpuf,unsigned char num ,u8 addr) // strpuf是传入的数组,num是传递的个数,addr是分配的地址{ I2CStart(); I2CSendByte(0xa0); I2CWaitAck ...
分类:
其他好文 时间:
2021-04-20 14:19:34
阅读次数:
0
1.饿汉式,这种方式不推荐,会造成资源的浪费。 public class Hungry { private Hungry(){ } private static Hungry hungry = new Hungry(); public static Hungry getInstance(){ ret ...
分类:
其他好文 时间:
2021-04-20 14:07:56
阅读次数:
0
public class Main { public static void main(String[] args) { test test = new test(); test.xxx(new zi()); } } class fu{ public void x(){ System.out.pri ...
分类:
其他好文 时间:
2021-04-20 14:06:09
阅读次数:
0
public class StatePattern { public static void main(String[] args) { Context context=new Context(); for (int i = 0; i < 10; i++) { context.handle(); } ...
分类:
其他好文 时间:
2021-04-19 16:06:54
阅读次数:
0
解决属性名和字段名不一致的问题 1.出现的问题 数据库中的字段 ? 新建一个项目,拷贝之前的,测试实体类与数据库字段不一致的情况 public class User { private int id; private String name; private String password; } 现 ...
分类:
其他好文 时间:
2021-04-19 16:03:47
阅读次数:
0
1 #include<iostream> 2 #include<string> 3 #include<vector> 4 #include<algorithm> 5 using namespace std; 6 7 void test01() 8 { 9 vector<int> v; 10 for( ...
分类:
编程语言 时间:
2021-04-19 15:55:39
阅读次数:
0
生成RSA密钥 1. 制作密钥对 [root@host ~]$ ssh-keygen <== 建立密钥对 Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): ...
分类:
系统相关 时间:
2021-04-19 15:54:27
阅读次数:
0