包装类 装箱 Integer i=new Integer(int i) 参数为基本数据类型 Integer i=new Integer(Stirng str) 参数为基本数据类型的字符串,否则会报异常,例如"a" 拆箱 int i2=i.intValue() 备注: jdk1.5之后支持自动装箱与拆 ...
分类:
编程语言 时间:
2020-05-31 21:30:20
阅读次数:
78
i++操作也可分为三个步骤:读i的值,进行i+1,设置i的值。 如果两个线程同时对i进行i++操作,会出现如下情况 i设置值为0 线程A读到i的值为0 线程B也读到i的值为0 线程A执行了+1操作,将结果值1写入到内存 线程B执行了+1操作,将结果值1写入到内存 此时i进行了两次i++操作,但是结果 ...
分类:
其他好文 时间:
2020-05-31 20:05:17
阅读次数:
62
1、Integer是int的包装类,int则是java的一种基本数据类型 2、Integer变量必须实例化后才能使用,而int变量不需要 3、Integer实际是对象的引用,当new一个Integer时,实际上是生成一个指针指向此对象;而int则是直接存储数据值 4、Integer的默认值是null ...
分类:
编程语言 时间:
2020-05-31 16:11:00
阅读次数:
86
原理:用户输入一个字符串,我们将这个字符串转换为一个char数组,再使用增强for循环去遍历这个数组,将得到的字符作为key,再定义一个计数器count作为value存储到一个HashMap集合中,若这个key只出现一次,则将value赋值为1,若key重复出现,则用后一个key覆盖前面的key,v ...
分类:
其他好文 时间:
2020-05-31 11:26:31
阅读次数:
58
public class User implements Comparable{ private String name; private int age; public User() { } public User(String name, int age) { this.name = name; ...
分类:
编程语言 时间:
2020-05-30 22:19:46
阅读次数:
85
1、点击空白页面,然后选择测试窗口。 2、点击完之后就会弹出一个测试窗口的页面 3、然后就可以输入sql进行调试 -- Created on 2020/5/30 by 123 declare -- Local variables here i integer; O_MSG VARCHAR2(50); ...
分类:
数据库 时间:
2020-05-30 15:53:10
阅读次数:
158
今天在工作中使用mybatis plus的selectBatchIds(List<Integer> ids)方法时,oracle报了ORA-01795的错。 则是因为oracle中使用 in 有限制,后面集合数目不能大于1000个,否则就会报错。 所以可以使用这种形式来规避。 select ... ...
分类:
其他好文 时间:
2020-05-30 14:18:47
阅读次数:
84
不断更新值和进位。 class Solution { public: int getSum(int a, int b) { return b == 0 ? a : getSum(a ^ b, ((unsigned int)a & b) << 1); } }; ...
分类:
其他好文 时间:
2020-05-30 01:24:53
阅读次数:
70
1049 Counting Ones (30分) The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of th ...
分类:
其他好文 时间:
2020-05-29 23:43:50
阅读次数:
106
题目描述 Created by Edwin Xu on 5/15/2020 11:35 PM 给定一个整数数组和一个整数 k,你需要找到该数组中和为 k 的 连续的子数组的个数。 示例 1 : 输入:nums = [1,1,1], k = 2 输出: 2 , [1,1] 与 [1,1] 为两种不同的 ...
分类:
编程语言 时间:
2020-05-29 22:55:36
阅读次数:
65