Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321 1 public class Solution { 2 public int reverse(int x) { 3 ...
分类:
编程语言 时间:
2014-09-23 12:10:24
阅读次数:
235
intcompareTo(To)Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is le...
分类:
编程语言 时间:
2014-09-22 23:21:13
阅读次数:
173
Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.搜了一下,才知道这道题可以写这么简洁。 1 class ...
分类:
其他好文 时间:
2014-09-22 23:17:03
阅读次数:
195
Desert KingTime Limit: 3000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:272864-bit integer IO format:%lld Java class name:Mai...
分类:
其他好文 时间:
2014-09-22 17:59:12
阅读次数:
246
1 /** 将中文字符串剪切为在当前db2(编码GBK)中所占用的长度*/ 2 public String cutStringForDb2(String src,Integer size) { 3 int len = src.length(); 4 ...
分类:
其他好文 时间:
2014-09-22 12:48:02
阅读次数:
270
AtomicInteger,一个提供原子操作的Integer的类。在Java语言中,++i和i++操作并不是线程安全的,在使用的时候,不可避免的会用到synchronized关键字。而AtomicInteger则通过一种线程安全的加减操作接口。
来看AtomicInteger提供的接口。
//获取当前的值
public final int get()
//取当前的值,并设置...
分类:
编程语言 时间:
2014-09-22 12:35:22
阅读次数:
149
要想搞清楚int和integer的区别,需要先搞清楚什么叫包装类。虽然 Java 语言是典型的面向对象编程语言,但其中的 8 种基本数据类型并不支持面向对象的编程机制,基本类型的数据不具备“对象”的特性--不携带属性、没有方法可调用。沿用它们只是为了迎合人类根深蒂固的习惯,并的确能简单、有效地进行常...
分类:
编程语言 时间:
2014-09-22 03:50:41
阅读次数:
196
字符串-〉数字Strings;inti;i=Integer.parseInt(s);数字-〉字符串Strings;inti;s=String.valueOf(i);//或者s=Integer.toString(i);
分类:
移动开发 时间:
2014-09-22 03:20:02
阅读次数:
182
SightseeingTime Limit: 2000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:346364-bit integer IO format:%lld Java class name:Mai...
分类:
其他好文 时间:
2014-09-22 00:52:31
阅读次数:
370
Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express...
分类:
其他好文 时间:
2014-09-21 17:54:51
阅读次数:
226