?????????????Java???л????????????????????????Java???????????????????????????????????????????????????????Java????????????????????????????????????????????????????????????в???"//"????????????????????в???/*...*/???????
/*
HelloWorld??????Java????????
????ú?????
*/
public class HelloWorld {
public static void main(String[] args) {
// ???Hello World!
System.out.println("Hello World!");
}
}
????????????????????????????????javadoc?????????????????????API????????????????ο???JDK API??????????????http://dlc.sun.com.edgesuite.net/jdk/jdk-api-localizations/jdk-api-zh-cn/builds/latest/html/zh_CN/api/??????????治???????????????????б???(?????)?????б???(???·?)??????????(???)????????"???б???"?е???????????????????????????????????????????????????????????javadoc?????????API????????????????javadoc???????public??protected???ε???????????????????????????????????????????????????????????????????????????????????private???????????????????-private??????????/**...*/???????javadoc???????£?
????javadoc -d [API????????] -windowtitle [API????????????] -doctitle [??????????] -header [????ü] ... Java????/?? (??????javadoc -help?????????)
????????????а?????????????????-locale?? -encoding?? -charset???£?
????javadoc -d [API????????] -windowtitle [API????????????] -doctitle [??????????] -header [????ü] -encoding utf-8 -charset utf-8 -locale zh_CN ... Java????/?? (??????javadoc -help?????????)
?????????????????????????????????????????????????javadoc???(??@author??@version??@param??@return??)????Щ?????????????
package miracle;
/**
* Description:
* <br/>????????????Javadoc???????????????
* <br/>????????TestJavadoc.java
* <br/>??д?????2012-08-22
* @author Miracle?? He miracle@sina.com
* @version 1.0
*/
public class TestJavadoc {
/**
* ????????
*/
protected String name;
/**
* ???????????????
* @param args ????????б?
*/
public static void main(String[] args) {
System.out.println("Hello?? Miracle!");
}
}
package miracleHe;
/**
* Description:
* <br/>????????????Javadoc???????????????
* <br/>????????TestJavadocTag.java
* <br/>??д?????2012-08-22
* @author Miracle?? He miracle@sina.com
* @version 1.0
*/
public class TestJavadocTag {
/**
* ????????????к?
* @param name ???к??????
* @return ??????к???????
*/
private String hello(String name) {
return name + "??????";
}
}
???????????????????????miracle??miracleHe(???????????)????????????????API?????
????javadoc -d apidoc -windowtitle "Generate Javadoc" -doctitle "Learning HelloWorld Class by Javadoc" -header "Javadoc Test" -charset "utf-8" -encoding "utf-8" Test*.java
???????????2??????@author??@version???????????????????????
????javadoc -d apidoc -windowtitle "Generate Javadoc" -doctitle "Learning HelloWorld Class by Javadoc" -header "Javadoc Test"-charset "utf-8" -encoding "utf-8" -author -version Test*.java
????Java??????????????????????????????????????????????????????á???????????: ????????(Primitive Type)??????????(Reference Type)?????????????£????????????????????(byte??short??int??long)?????????(char)??????????(float??double)?????????(true??false)??????????????????(String)?????顢???????????(null)????????????????????????С??????(??byte??short???Χ???)?????byte??short??????????????????????????????????????(????int???Χ)???????????????long?????д????????????L?????б????????????????int???Χ?????????long????????????L?????????int??
????public class TestInteger {
????public static void main(String[] args) {
????byte b = 56; //???????????byte
????//long big = 999999999999; //?????????????long??????
????long big2 = 41433333313243133L; //???L????long????
????}
????}
????????????????????????????????e????(0???)??????????(0x?????A~F????10~15)?????б????
????int octalValue = 013;
????int hexValue = 0x2F;
??????????????????????????????????????(0~65535?????????????)???????????????''(??'A')????????(' '??' ')??Unicode('uXXXX'???256???????ASCII?????)????????????0~65535????????????char??????????int????char?????
????public class TestChar {
????public static void main(String[] args) {
????//?????????
????char a = 'a';
????char enter = ' ';
????char ch = 'u24af';
????System.out.println(ch);//?????
????char yu = '??';
????int yuValue = yu;
????System.out.println(yuValue);//23431
????char c = 97;
????System.out.println(c);//a
????}
????}
?????????????????????????????(????????????)??????????????????????????????????????????????????????????????????(float)????????????(double)??????float?4?????????λ?????λ????????8λ?????λ????23λ??β??????????????F??double?8?????????λ?????λ????????11λ?????λ????52λ??β????????????????????????D??????????????????????(??5.12??.512)??????????(5.12E2)???????????????????????????????????????????????????(POSITIVE_INFINITY?????????????0???)?????????(NEGATIVE_INFINITY?????????????0???)?????(NaN?????0.0????0.0?????????????)???????????????????????и????????????????????κ??????(????NaN??????????)??
????public class TestFloat {
????public static void main(String[] args) {
????float f = 5.12F;
????double zero = 0.0;
????float p = Float.POSITIVE_INFINITY;
????double n = Double.NEGATIVE_INFINITY;
????System.out.println(p==n);//false
????System.out.println(f/zero);//Infinity
????System.out.println(f/zero==p);//true
????System.out.println(0.0/zero==Double.NaN);//false
????System.out.println(6.0/0==8.2/0);//true
????System.out.println(1/0);//?????
????}
????}
?????????????bool????????true??false????????0???0????????????????????????????bool????????bool?????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????