CrazyJava

可在百度文库中搜索:疯狂java讲义全知识点笔记摘录。

Data Type
1.//change the char to the int directly
//Notice :the char use ‘ ’,the String use ” ”
char ch=‘c’;
Int cValue=ch;
2.“c:\codes”should be written as “c:\codes”
3.boolean can only be true or false; cannot be other numbers
4.—>String s0=“hello”;
—>String s1=“hello”;
—>String s2=“hel”+”lo”
—>System.out.println(s0s1);
—>System.out.println(s1s2);
<—true
<—true
5.java 创建对象的常见方式:
@1.通过new调用构造器创建java对象;
@2.通过class对象的newInstance()方法调用构造器创建java对象;
@3.通过java的反序列化机制从IO流中恢复Java对象;
@4.通过java对象提供的clone()方法复制一个新的Java对象;
@5.除此之外,对于字符串以及Byte,Short,Integer,Long,Character,Float,Double,Boolean这些基本类型的包装类,Java还允许以直接量的方式来创建Java对象,列入如下语句:
String str=“ABC”;等
除此之外,通过简单的算术表达式,连接运算来创建Java对象,列入如下语句:
String str2=“ABC”+“efg”;

Array
1.one array can only have one type of object (not only can save data). in it.when array has been seated ,it siz

你可能感兴趣的:(CrazyJava)