equals()方法是根类Object中的一个方法,子类可以根据需要重写该方法(比如:String类)。一、Object类中的equals()方法实现如下:1 public boolean equals(Object obj) {2 return (this == obj);...
分类:
其他好文 时间:
2015-07-21 12:25:28
阅读次数:
101
1. 获取IOS APP占用的内存#import // ...void report_memory(void) { struct task_basic_info info; mach_msg_type_number_t size = sizeof(info); kern_return_t ke...
分类:
移动开发 时间:
2015-07-21 12:23:55
阅读次数:
220
(1)、判断是否为数值function isNum(obj){ return !isNaN(parseFloat(obj)) && isFinite(obj);}(2)、判断是否为数值function isEmptyObject(){ var name; //遍历不是空对象返回 for (n...
分类:
Web程序 时间:
2015-07-21 12:23:19
阅读次数:
147
1、一个获取ID 元素的// 获取元素对象 function g(id){return document.getElementById(id);}//用法 以oDiv 为例var oDiv=g('oDiv');2、获取元素相对屏幕左边的距离 //获取元素相对屏幕左边的距离 传的参为ID...
分类:
Web程序 时间:
2015-07-21 12:14:08
阅读次数:
194
/** * * unicode 转换成 中文 * @param theString * @return */ public static String decodeUnicode(String theString) { char aC...
分类:
编程语言 时间:
2015-07-21 10:24:04
阅读次数:
148
public static T[] SetAllValues(this T[] array, T value){ for ( int i=0; i<array.Length;i++) { array[i]=value; } return array;...
分类:
编程语言 时间:
2015-07-21 10:17:06
阅读次数:
138
【017-Letter Combinations of a Phone Number (电话号码上的单词组合)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a digit string, return all possible letter combinations that the number could represent.
A mapping...
分类:
编程语言 时间:
2015-07-21 09:11:42
阅读次数:
133
【016-3 Sum Closest(最接近的三个数的和)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of th...
分类:
编程语言 时间:
2015-07-21 09:10:14
阅读次数:
151
在任何一本Java教材中,异常处理都是作为单独的章节讲解的,足可见其分量。而真正的能够用好这个知识,只有经历实际项目的开发才会有点体会。1、try catch finally的执行顺序(1).一般情况下:try----catch----finally呢(2).如果try中有return:try---...
分类:
编程语言 时间:
2015-07-21 06:43:16
阅读次数:
125
题目描述
链接地址
解法
算法解释题目描述Given an array of integers, the majority number is the number that occurs more than half of the size of the array. Find it..ExampleGiven [1, 1, 1, 1, 2, 2, 2], return 1ChallengeO(n...
分类:
其他好文 时间:
2015-07-21 01:36:33
阅读次数:
186