?????淶

????????淶?????????????????е???????????????????д??????????????????????????????????????????????Щ?淶????????????????????????ó???????????????

Package ??????
Package ?????????????????Сд??????ɡ?

Class ??????
Class ????????????д?????????????????Сд????????

Class ??????????
??????????????????Сд???????????????????д????????

Static Final ??????????
Static Final ????????????????д????????????????塣

??????????
????????????????????????淶????

?????????
????????????????????????????
byte[] buffer; ???????byte buffer[];

?????????
????????????????????????????????ú????????????????????
SetCounter(int size){

this.size = size;

}

Java ??????
???е? Java(*.java) ????????????????μ????????

??????
???????????? java ????????????磺
/**

* Copyright ® 2000 Shanghai XXX Co. Ltd.

* All right reserved.

*/

??????????????? javadoc ???????????????????

Package/Imports
package ????? import ??????import ?б?????????????????????????????????????С???? import ???а????????????е???????????????? * ???????
package hotlava.net.stats;

import java.io.*;

import java.util.Observable;

import hotlava.util.Application;

???? java.io.* ?????????InputStream and OutputStream ???

Class
??????????????????????????????????

/**

* A class representing a set of packet and byte counters

* It is observable to allow it to be watched?? but only

* reports changes when the current set is complete

*/

???????????壬?????????????е? extends ?? implements

public class CounterSet

extends Observable

implements Cloneable

Class Fields

???????????????????

/**

* Packet counters

*/

protected int[] packets;

public ?????????????????????JavaDoc????proceted??private?? package ????????????????????????????????????????

???????
???????????????????????????????????????????????????????????????д????????
/**

* Get the counters

* @return an array containing the statistical data. This array has been

* freshly allocated and can be modified by the caller.

*/

public int[] getPackets() { return copyArray(packets?? offset); }

public int[] getBytes() { return copyArray(bytes?? offset); }

public int[] getPackets() { return packets; }

public void setPackets(int[] packets) { this.packets = packets; }

????????????д???????

 

 

?????д???

???????
????????? unix ???????????? windows ??????磺????????+???У?

?????
?????? javadoc ??????????????????????????????????????? java ???????????????????? @author ?????????????????????????????????е??

????
????????????2?????. ??????????б???Tab???. ????ò????????????????Tab???????????????????????????????.
???????? UltrEdit ?????? Java ????????????????????????2????????????Tab????? ????????? UltrEdit?????趨 Tab ?????????2?????????? Format|Tabs to Spaces ????? Tab ???????

???
???????????80???. ??????????????????? ?????????????????? ????????????????????. ???κ?????£? ???????????????????????????????????????. ?????????к? ??????????????????2?????.

{ } ??

{} ?е????????????????. ???磬 ??????1????????? ??2?????????:

if (i>0) { i ++ }; // ???? { ?? } ??????

if (i>0) {

i ++

}; // ????? { ??????????

} ????????????????.

??? } ?????????????????????? { ???????????λ?á?

????
???????????????????ó????? ????? ??????????????????????ó?????. ?????????????????????????????:

CallProc( AParameter ); // ????

CallProc(AParameter); // ???

????????????????????????. ??????????????????????????????С????????????????????????÷?: if ((I) = 42) { // ???? - ???????????

if (I == 42) or (J == 42) then // ??? - ??????????

 

 

?????д?淶

exit()
exit ?????? main ?п?????????????????????????á???????????????κδ?????????????????????????????????????????????????????????????????

??
??????????????????RuntimeException??????????????
?????main()??????y?????е?????????????????????????У?????????

???????
JAVA??ó??????????????????????????ü??????????????????????????????????????????????????峽?????????????prel?????????????д??

...

{

FileOutputStream fos = new FileOutputStream(projectFile);

project.save(fos?? "IDE Project File");

}

...

??????????????????????????ü?????????????????JAVA???????????????????峽????????????????????д??

FileOutputStream fos = new FileOutputStream(projectFile);

project.save(fos?? "IDE Project File");

fos.close();

Clone ???????????????????

implements Cloneable

public

Object clone()

{

try {

ThisClass obj = (ThisClass)super.clone();

obj.field1 = (int[])field1.clone();

obj.field2 = field2;

return obj;

} catch(CloneNotSupportedException e) {

throw new InternalError("Unexpected CloneNotSUpportedException: " + e.getMessage());

} }

final ??
??????????????????? final ????????????????
???????????????????У??????????????????????????????? final ???????????????????????????????????????????

?????????????
???????????????????? protected ????????????????????

??????"int[] packets"????????"int packets[]"???????????????á?

public void setPackets(int[] packets) { this.packets = packets; }

CounterSet(int size)

{

this.size = size;

}
??????

byte ????????? characters

???? byte ????????? characters??????????????

"Hello world!".getBytes();
Utility ??

Utility ???????????????????????????????????????л????????

?????

??????????????????????????????

objectArguments = new Object[] { arguments };

???????

JAVA ??????????????????????????????????????壺

class Colour {

public static final Colour BLACK = new Colour(0?? 0?? 0);

public static final Colour RED = new Colour(0xFF?? 0?? 0);

public static final Colour GREEN = new Colour(0?? 0xFF?? 0);

public static final Colour BLUE = new Colour(0?? 0?? 0xFF);

public static final Colour WHITE = new Colour(0xFF?? 0xFF?? 0xFF);

}

????????????RED?? GREEN?? BLUE ??????????????????????????????????? ????????? == ????????????????????????????????????????????????????????????? BLACK

new Colour(0??0??0)

??????????????????==??????????????????? equal() ?????????Ч??????????????????????????????????У??????????????????á?

Swing

??????? AWT ???

?????? AWT ?? Swing ???

?????? AWT ????? Swing ???????????????????С????á????????????????????????????á?

?????? AWT ???

AWT ???????? JscrollPane ???????????????? AWT ?????????????? AWT ScrollPane ?????????

?????? InternalFrame ???????? AWT ???

??????????????????????????????????

Z-Order ????

AWT ???????????? Swing ???????????e??? AWT ????? POP-UP ?????????С????????????????á?

????

???????????????????????????????????????????????????????С???????????????????????????

?????????????????????? PrintStream ??????????ж?????????????? null???????????? debug ????????????????????

????

??д?????????????β???????????????????????????????????????????????????????????????????????Ч??????磺???????????????????Ч??????????????????????м?????????????????п????????????????

???????е?????????д???????????????????????????????????????????????????????????????????????????????????????????

????????????

?????????й??????????

??? StringBuffer ????

????? String ????????????? StringBuffer ??StringBuffer ??????? String ????????String ?? StringBuffer ???????????????????????????????????????????????????????????????????????????????????? StringBuffer ???????????????????????? StringBuffer ??????????????? String ???????磺??????????????????????????????????????????????????????? StringBuffer ????????? append() ??????????????? String ??????? StringBuffer ???????????????????????????????? CPU ???

??????????? synchronized ?????

???????????ù???? synchronized????????????????????????????????????????÷?????

???????

Borland Jbulider ????? synchronized ???????????????????????Щ????????????????????????????????????????????????????????????????????á?

????

?????????е?????????? println ??????????????????" "??

????????? System.out.print("Hello??world! ");

??????? System.out.println("Hello??world!");

????????????????з??????????????????????? String newline = System.getProperty("line.separator");

System.out.println("Hello world" + newline);
PrintStream

PrintStream ???????????deprecated???????? PrintWrite ??????????