前端缓存 缓存概述 在计算机领域中,缓存是一项十分重要的技术。 在软件开发,亦或者是在硬件设计开发中,缓存对性能的影响是十分显著的。 学过Java,会知道在Integer的自动装箱中 这个范围中的转换会有些特殊的表现,稍加研究源码,会知道这是因为Integer中的缓存类有关(该缓存类会使用数组存储[ ...
分类:
其他好文 时间:
2020-02-21 13:07:42
阅读次数:
100
本题思路是用一个key-value数据结构去保存已经遍历到的数字。 public int[] twoSum(int[] nums, int target) { HashMap<Integer, Integer> hm = new HashMap<>(); for(int i =0; i<nums.l ...
分类:
其他好文 时间:
2020-02-20 14:55:36
阅读次数:
63
AtomicInteger ,一个提供原子操作的 Integer 的类,常见的还有AtomicBoolean、AtomicInteger、AtomicLong、AtomicReference 等,他们的实现原理相同, 区别在与运算对象类型的不同。令人兴奋地,还可以通过 AtomicReference ...
分类:
其他好文 时间:
2020-02-20 13:02:47
阅读次数:
58
一. 数值类型 类型 存储大小 描述 范围 smallint 2字节 小范围整数 -32768 ~ +32767 integer 4字节 整数的典型存储 -2147483648 ~ +2147483647 bigint 8字节 大范围整数 -9223372036854775808 ~ 9223372 ...
分类:
数据库 时间:
2020-02-20 12:56:10
阅读次数:
92
做Java开发的人,一生至少该有一次或多次遇到【For input String: ""】这样的报错问题,原因通常都是出现在字符串强制转换成数值类型的时候报的错。 比如: String yanggb = ""; int num = Integer.parseInt(yanggb); 这段代码就会报出 ...
分类:
编程语言 时间:
2020-02-20 10:13:32
阅读次数:
174
Description Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: ...
分类:
其他好文 时间:
2020-02-20 09:52:52
阅读次数:
75
Description Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, jus ...
分类:
其他好文 时间:
2020-02-20 09:28:12
阅读次数:
79
示例: 输入: "the sky is blue", 输出: "blue is sky the". trim()去除字符串两头空格, "split()的用法" ...
分类:
其他好文 时间:
2020-02-19 22:30:13
阅读次数:
173
public class Solution { /** * @param costs: n x 3 cost matrix * @return: An integer, the minimum cost to paint all houses */ public int minCost(int[][ ...
分类:
其他好文 时间:
2020-02-19 21:05:47
阅读次数:
63
public class Solution { /** * @param s: a string, encoded message * @return: an integer, the number of ways decoding */ public static int numDecodings ...
分类:
其他好文 时间:
2020-02-19 20:54:13
阅读次数:
67