Java基础
jtchan
刻苦
展开
-
使用Java接口对象
List list = new ArrayList();ArrayList arrayList = new ArrayList();两个定义有什么区别,用接口有什么好处?原创 2011-07-13 11:09:41 · 279 阅读 · 0 评论 -
java继承
class ex{ int i = 1;}interface ie{ int i = 3;}public class TestExtends extends ex implements ie{ int i = 2; //如果注释此行 则1处给编译错误:The f原创 2011-07-22 08:52:32 · 173 阅读 · 0 评论 -
Integer.toString(11,8) 源码分析
Integer.toString(11,8) 将11转换成8进制数实现过程(源码分析):public static String toString(int i, int radix) { if (radix Character.MAX_RADIX) //如果rad原创 2011-07-18 16:09:48 · 371 阅读 · 0 评论 -
valueOf与parseInt到底哪个快的问题
public static Integer valueOf(String s, int radix) throws NumberFormatException { return Integer.valueOf(parseInt(s,radix)); } public原创 2011-07-18 16:33:10 · 489 阅读 · 0 评论 -
System.getProperty("java.class.path")
Properties 类表示了一个持久的属性集。Properties 可保存在流中或从流中加载。属性列表中每个键及其对应值都是一个字符串。 一个属性列表可包含另一个属性列表作为它的“默认值”;如果未能在原有的属性列表中搜索到属性键,则搜索第二个属性列表。 因为 Propertie原创 2011-07-18 17:05:39 · 1993 阅读 · 0 评论 -
Integer.decode("-011")
Integer.decode("-011")public static Integer decode(String nm) throws NumberFormatException将 String 解码为 Integer。接受通过以下语法给出的十进制、十六进制和八进制数字: De原创 2011-07-18 17:20:11 · 733 阅读 · 0 评论 -
Java链表
待补原创 2011-07-19 16:05:20 · 311 阅读 · 0 评论 -
向上转型
对象既可以作为它自己本身的类型使用,也可以作为它的基类型使用。而这种把对某个对象的引用视为对其基本类型的引用的做法被称作向上转型因为在继承树的画法中,基类是被放置在最上面的。原创 2011-07-19 17:04:35 · 193 阅读 · 0 评论 -
java匿名内部类
public class Parcel7{ public Contents contents()//Contents cannot be resolved to a type { return new Contents()//Contents canno原创 2011-07-20 14:59:30 · 230 阅读 · 0 评论 -
try catch finally
public class TestTry {public static void main(String[] args) {System.out.println(test());//为什么打印 1?}private static int test(){原创 2011-10-14 21:06:37 · 198 阅读 · 0 评论