Object 类类a) Object 类是所有 Java 类的根基类b) 如果在类的声明中未使用 extends 关键字指明其基类,则默认基类为 Object 类toString()返回该对象的字符串表示。 通常 toString 方法会返回一个 “以文本方式表示” 此对象的字符串,Object 类...
分类:
其他好文 时间:
2015-01-17 16:26:20
阅读次数:
150
注意:标的名单文件要写在与包名同一级别的目录下,记载src上右击,点新建文件file,把名单复制到此文件中,程序就可以依据一些策略访问这个名单的内容
ArrayList是List(列表),数据是有序的,可以有重复元素
HashSet是Set(集合),数据没有顺序,没有重复元素,元素搜索速度快
package 随机分组;
import java.util.ArrayList;
impo...
分类:
编程语言 时间:
2015-01-15 20:21:20
阅读次数:
248
private boolean isAvilible(Context context, String packageName) {
if (packageName == null || "".equals(packageName))
return false;
PackageManager pageManage = getPackageManager();
List packages = ...
分类:
其他好文 时间:
2015-01-15 12:56:59
阅读次数:
141
Java中判断非空对象.Java中经常会遇到判断非空的时候. 有的时候判断了非空但是还是报空指针,为什么.?判断的时候一般都会判断两次.类似于:Java代码 Orgo=newOrg();if(o.getId()!=null&&!o.getId.equals("")){Orgoo=orgService...
分类:
编程语言 时间:
2015-01-15 12:25:46
阅读次数:
148
方法:public static Map changeMap(String xmlDoc) { if (!xmlDoc.equals("") && (xmlDoc != null)) { // 创建一个新的字符串 StringReader xmlString = new StringRead...
分类:
其他好文 时间:
2015-01-15 10:49:05
阅读次数:
184
1、==和equals的区别 null和""的区别
2、15个顶级Java多线程面试题及回答
(1)、线程中join的使用
在很多情况下,主线程生成并起动了子线程,如果子线程里要进行大量的耗时的运算,主线程往往将于子线程之前结束,但是如果主线程处理完其他的事务后,需要用到子线程的处理结果,也就是主线程需要等待子线程执行完成之后再结束,这个时候就要用到join()...
分类:
编程语言 时间:
2015-01-14 21:25:47
阅读次数:
173
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2015-01-14 16:58:45
阅读次数:
167
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum
= 22,
5
/ ...
分类:
其他好文 时间:
2015-01-14 16:55:08
阅读次数:
202
HashMap 和 HashSet 是 Java Collection Framework 的两个重要成员,其中 HashMap 是 Map 接口的常用实现类,HashSet 是 Set 接口的常用实现类。虽然 HashMap 和 HashSet 实现的接口规范不同,但它们底层的 Hash 存储机....
分类:
编程语言 时间:
2015-01-14 11:00:55
阅读次数:
170
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example: Given the below binary tree and sum...
分类:
其他好文 时间:
2015-01-13 19:55:05
阅读次数:
174