?????娣�

????????娣�?????????????????械???????????????????写??????????????????????????????????????????????些?娣�????????????????????????贸???????????????

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 ??????????