基础篇 1、int和Integer的区别 1、Integer是int的包装类,int则是java的一种基本数据类型 2、Integer变量必须实例化后才能使用,而int变量不需要 3、Integer实际是对象的引用,当new一个Integer时,实际上是生成一个指针指向此对象;而int则是直接存储数 ...
分类:
其他好文 时间:
2020-05-25 12:33:35
阅读次数:
50
class Solution { public List<Integer> diffWaysToCompute(String input) { List<Integer> ways = new ArrayList<>(); for (int i = 0; i < input.length(); i+ ...
分类:
其他好文 时间:
2020-05-25 12:25:22
阅读次数:
59
看一下题目大意: For a given positive integer n, please find the smallest positive integer x that we can find an integer y such that y^2 = n +x^2.。 自己翻译一下,不难 ...
分类:
其他好文 时间:
2020-05-25 12:06:37
阅读次数:
75
报错:No cache could be resolved for 'Builder[public abstract com.example.cache.generate.Department com.example.cache.generate.DepartmentDao.selectByPrim ...
分类:
系统相关 时间:
2020-05-25 00:27:12
阅读次数:
315
一、什么是队列 队列是一种特殊的线性表,只能在头尾两端进行操作,特点是先进先出;就像排队买票一样,先来的先买 二、接口设计 三、代码实现 可以使用动态数组、链表等实现;这里两种实现栈与双向链表 1、栈 public class Queue { private Stack<Integer> inSta ...
分类:
编程语言 时间:
2020-05-25 00:08:12
阅读次数:
52
String型转基本类型: 1.转换成Int型 int/Integer num = Integer.parseInt(String str); 2.转换成long型 long/Long num = Long.parseLong(String str); 3.转换成short型 short/Short ...
分类:
编程语言 时间:
2020-05-24 22:35:27
阅读次数:
92
在程序循环内终止更好。 class Solution { public: int reverse(int x) { int num = 0; while (x != 0) { int n = x % 10; x /= 10; //-2,147,483,648 ~ 2,147,483,647 if ( ...
分类:
其他好文 时间:
2020-05-24 12:08:42
阅读次数:
43
6、简易计算器、组合+内部类回顾复习 当前的代码(面向过程) 组合的方式优化(完全对象化),面向对象: 内部类的优化: ...
分类:
其他好文 时间:
2020-05-24 11:52:29
阅读次数:
55
CAS是什么? CAS全称Compare-And-Swap,它是一条CPU并发原语。它的作用是判断内存的某个位置的值是否为预期值,如果是则改为新值,在这个过程中是原子性的。 sum.misc.Unsafe类中有多个方法被native关键字标记,这说明该方法是原生态的方法,它是一个调用非java语言的 ...
分类:
其他好文 时间:
2020-05-24 11:26:37
阅读次数:
59
一对一使用association 一对多使用ollection 班级实体类 public class Clazz implements Serializable { private Integer id; private String name; } 学生实体类 public class Stude ...
分类:
其他好文 时间:
2020-05-24 10:12:21
阅读次数:
73