锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
鍙互浠庝腑鎵懼埌澶ч儴鍒嗘枃浠舵牸寮忕殑鐩稿叧淇℃伅銆備緥濡侭MP錛孫bj絳夌瓑銆?br />
http://www.csit.fsu.edu/~burkardt/data/obj/obj.html
浠嬬粛OBJ鏂囦歡鏍煎紡錛屽叧閿槸褰撲腑鎻愪緵浜嗚鍐欏拰杞崲OBJ鏂囦歡鐨勫伐鍏峰緩璁?br />
]]>
灝變竴騫呭浘錛屼粩緇嗙湅鐪嬪拰鑱旀兂涓涓嬶紝涔熻浼氭湁鐐瑰緱鐩?-)
(2)
Introduction to Algorithms, Second Edition
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein
MIT
銆婄畻娉曞璁猴紝褰卞嵃鐗堛嬮珮絳夋暀鑲插嚭鐗堢ぞ
(3)
Intruduction to The Design and Analysis of Algorithms
(US)Anany Levitin
綆楁硶璁捐涓庡垎鏋愬熀紜
娼樺濺 璇懧?
娓呭崕澶у鍑虹増紺?br />
鍏跺疄絎竴鏈垜娌℃湁鐪嬭繃錛屽彧鏄彁鍙婄畻娉曟柟闈㈢殑涔︾睄錛岃繖涓鏈ソ鍍忛兘搴旇涓轟漢鎵鐭ラ亾浼肩殑銆傜浜屾湰鐨勮紼嬭祫鏂欏彲浠ュ湪mit鐨刼pen course ware欏甸潰涓嬭澆銆傜涓夋湰鐨勮瘧鏈緢涓嶉敊錛屾劅瑙夊緢鏈夌偣騫介粯鏈夎叮錛岃屼笖涔︾殑緇撴瀯鎸烘柊棰栵紝涓嶈嚦浜庤浜洪┈涓婂綆楁硶榪欎笢瑗胯寰楁亹鎬栧拰鐑﹂椃銆傛帹鑽愮涓夋湰銆?/p>
鑱旈?-- GSM聽 130,131,132聽聽聽聽聽聽 鎵嬫満浣跨敤鑱旈歋IM鍗?br />聽聽聽聽聽聽聽聽聽-- CDMA 133 (鑱旈氭柊鏃剁┖)錛屾墜鏈轟嬌鐢║IM鍗?/p>
GSM姣旇緝綆鍗曘傛墍璋撶殑GSM 900/1800/1900鏄寚GSM鎵嬫満鐨勫伐浣滈鐜囷紝鍒嗗埆鏄腑鍥界Щ鍔ㄦ敮鎸佺殑900MHz錛?900MHz鍜岀編鍥藉父鐢ㄧ殑1900MHz銆傚湪鍥藉唴鐢ㄦ敮鎸?00MHz鍜?800MHz鐨凣SM 900/1800鍙岄鎵嬫満灝卞彲浠ヤ簡銆傚鏋滆鍑哄浗鍒扮編鍥界敤鐨勶紝灝辮鐢ㄦ敮鎸?900MHz鐨勪笁棰戞墜鏈轟簡銆?/p>
CDMA姣擥SM鐨勯氳瘽璐ㄩ噺銆佹墜鏈鴻緪灝勫皬鍜屼繚瀵嗘ф柟闈㈤兘濂斤紝浣嗘槸鎶鏈?=甯傚満銆?br />CDMA -- CDMA800
聽聽聽聽聽聽聽聽聽聽 聽-- CDMA 1X 鐜板湪鑱旈欳DMA緗戠粶鎵閲囧彇鐨勬妧鏈備笌鐪熸鐨凜DMA2000鐩告瘮錛孋DMA 1x灝卞儚鎴戝垰鎵嶈鐨勶紝鍙兘鏀寔鍒?53.6kbps鐨勬暟鎹熷害錛屽洜姝よ縐頒負鏄?.5G鐨勬妧鏈紝榪樹笉鏄湡姝?G鐨勬妧鏈?br />聽聽聽聽聽聽聽聽聽 聽 -- CDMA2000 涓縐?G鐨勬爣鍑嗐?/p>
3G 鏈変笁涓爣鍑?br />聽聽聽聽聽聽聽聽聽聽聽 -- WCDMA 鏈夊埄浜庝腑鍥界Щ鍔紝璁懼鐢辨媧茶繘鍙o紝瀹規槗鍗囩駭鍒癢CDMA銆傝繖濂楃郴緇熻兘澶熸灦璁懼湪鐜版湁鐨凣SM緗戠粶涓婏紝瀵逛簬緋葷粺鎻愪緵鍟嗚岃█鍙互杈冭交鏄撳湴榪囨浮錛岃孏SM緋葷粺鐩稿綋鏅強鐨勪簹媧插榪欏鏂版妧鏈殑鎺ュ彈搴﹂鏂欎細鐩稿綋楂樸傚洜姝-CDMA鍏鋒湁鍏堝ぉ鐨勫競鍦轟紭鍔褲?br />聽
聽聽聽聽聽聽聽聽聽聽聽聽 -- CDMA2000 鍒╀簬鑱旈氾紝璁懼鐢辯編鍥借繘鍙o紝瀹規槗鍗囩駭鍒癈DMA2000銆傜洰鍓嶄嬌鐢–DMA鐨勫湴鍖哄彧鏈夋棩銆侀煩鍜屽寳緹庯紝鎵浠DMA2000鐨勬敮鎸佽呬笉濡俉-CDMA澶氥備笉榪嘋DMA2000鐨勭爺鍙戞妧鏈嵈鏄洰鍓嶅悇鏍囧噯涓繘搴︽渶蹇殑錛岃澶?G鎵嬫満宸茬粡鐜囧厛闈笘銆?
聽聽聽聽聽聽聽聽聽聽聽聽 -- TD-SCDMA 涓浗鑷繁鏈夌嫭绔嬬煡璇嗕駭鏉冪殑浜у搧銆傞噰鐢ㄨ繖涓鏍囧噯錛屽浜庡浗闃茬瓑閲嶈棰嗗煙鍥芥皯緇忔祹瀹夊叏鏈夊埄銆傛嵁璇翠腑鍥界數淇″拰涓浗緗戦氶兘鍦ㄧ敵璇風Щ鍔ㄨ繍钀ョ墝鐓э紝浠栦滑鍊懼悜浜嶵DS-CDMA銆?br />聽聽聽聽聽聽 鑷充簬鐜板湪涓浗閲囩敤鍝竴縐嶇幇鍦ㄨ繕娌℃湁瀹氳銆傛瘯绔熼渶瑕佸競鍦哄拰浼佷笟鏉ユ渶緇堝喅瀹氾紝璁頒綇鎶鏈紭縐鐨勫茍涓嶄唬琛ㄦ渶緇堝氨鑳借儨鍑恒?br />
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 E. W. Dijkstra
璁$畻鏈烘槸涓涓伐鍏鳳紝涓涓漢閫犵殑宸ュ叿錛屼漢鍒墮犲伐鍏風殑鐩殑鏄粈涔堬紵鍗忓姪鑷繁瀹屾垚鐢熶駭鍔沖姩錛屾垨紜垏鍦拌鏄畬鎴愯嚜宸辯敓瀛樺拰鐢熸椿鐨勯渶瑕併傜敱浜庨渶瑕佸畬鎴愬ぇ閲忕殑榪愮畻鑰屼駭鐢熺殑璁$畻鏈猴紝鍗充嬌鏄埌鐜板湪涔熷眬闄愪簬淇℃伅鐨勫鐞嗭紝鍖呮嫭綆鍗曠殑榪愮畻鍜屼俊鎭紙鏁板瓧錛夌殑瀛樺偍銆?br />
鑰屽湪瀛︿範褰撲腑錛屸渟print錛宻truct鈥濈瓑榪欎簺鍚嶅瓧鍚搗鏉ョ湡鐨勫緢澶э紝鑰屾垜甯擱棶鑷繁鈥滄垜闇瑕佸涔犲畠鍚楋紵鈥濄傛槸鍚︿笉鎳傚畠浠氨涓嶇畻鎳俲ava浜嗗憿錛熸垜浠?鏈堜喚寮濮嬭寰梛ava紱昏嚜宸辮秺鏉ヨ秺榪滀簡錛屽洜涓烘垜涓婅澶氱殑鍏充簬java鐨勮鍧涳紝鐪嬪埌鐨勬瀬澶ч儴鍒嗛兘鏄璁烘鏋訛紝鑰屾垜瀵規娌℃湁浠涔堟蹇點傗滈渶姹傞┍鍔ㄥ涔犫濇槸鎴戠殑淇℃潯錛屾病鏈夎繖涓渶姹傦紝浣犲氨娌℃湁瀛︿範閭g浉搴旂煡璇嗙殑蹇呰錛屾洿娌℃湁鍔ㄥ姏銆備篃璁歌繖鏄垜鎳掔殑鍊熷彛:-) 澶ф鏄嚜宸卞皻涓旀槸瀛︾敓錛屾病鏈夋姇韜兘浼佷笟鐢熶駭褰撲腑鍥犳瀵硅繖浜涗紒涓氬紑鍙戠殑鐭ヨ瘑娌℃湁姒傚康鍚с傚弽姝h寰楃幇鍦ㄦ病鏈夊榪欎釜鐨勫繀瑕侊紝璋佺煡閬撲袱騫村悗鏄惁鏈変粈涔坰ummer or XXname鐨勬鏋跺嚭鐜板憿錛?br />
榪欎釜鏆戝亣鍏跺疄鑷繁榪樻槸鎯蟲妸鎻℃椂闂寸湅鐪嬩功鐨勶紝鍙嶆鍙堟病鏈夋壘鍒板疄涔犲伐浣溿備緥濡俤ata structure & algorithm錛岀畻娉曞垎鏋愯繖闂ㄨ娌℃湁瀛﹁繃錛岀湡鐨勯仐鎲撅紝鍙兘鑷繁琛ヨˉ錛涜繕鏈夐偅Developing Games in Java鐨刾art 3錛屽綋涓鐨勬槸3d鐨剅enderring錛岃屼笉娑夊強opengl浠ュ強java3d鎴杘pengl binding絳堿PI錛岃嚜宸辮繕鏄緢鏈夊叴瓚g殑銆傝屾槰澶╁湪鍥藉鐨勫ぇ瀛︾殑緗戠珯涓婁笅杞戒簡涓涓狾S璇劇▼鐨刲ecture notes錛屾濂藉涔犱竴涓嬫搷浣滅郴緇熺殑姒傚康銆?br />
The remaining two areas of system memory is where storage may be allocated by the compiler for data storage. The stack is where memory is allocated for automatic variables within functions. A stack is a Last In First Out (LIFO) storage device where new storage is allocated and deallocated at only one ``end'', called the Top of the stack. This can be seen in Figure 14.13.聽
聽
When a program begins executing in the function main(), space is allocated on the stack for all variables declared within main(), as seen in Figure 14.13(a). If main() calls a function, func1(), additional storage is allocated for the variables in func1() at the top of the stack as shown in Figure 14.13(b). Notice that the parameters passed by main() to func1() are also stored on the stack. If func1() were to call any additional functions, storage would be allocated at the new Top of stack as seen in the figure. When func1() returns, storage for its local variables is deallocated, and the Top of the stack returns to to position shown in Figure 14.13(c). If main() were to call another function, storage would be allocated for that function at the Top shown in the figure. As can be seen, the memory allocated in the stack area is used and reused during program execution. It should be clear that memory allocated in this area will contain garbage values left over from previous usage.
The heap segment provides more stable storage of data for a program; memory allocated in the heap remains in existence for the duration of a program. Therefore, global variables (storage class external), and static variables are allocated on the heap. The memory allocated in the heap area, if initialized to zero at program start, remains zero until the program makes use of it. Thus, the heap area need not contain garbage.
灝忕粨錛?br />Stack: automatic variables within functions
Heap: global variables (storage class external), and static variables
============================
In java 鎯呭喌濡備笅
(1)
聽The stack is the program memory area, so all your primitive type variables and the memory adress of your objects are written on the stack. It is a fast access valuable memory area.
The heap is where the VM keeps the objects, and it is a huge amount of memory. When you create an object, the VM puts the object in the HEAP and puts the adress of the object created on the STACK.
(2)
聽There are two kinds of memory used in Java. These are called stack memory and heap memory. Stack memory stores primitive types and the addresses of objects. The object values are stored in heap memory. An object reference on the stack is only an address that refers to the place in heap memory where that object is kept.
聽It is useful to know that these two different kinds of memory exist in Java. Stack memory is the program's memory, and heap memory resides outside of the program.榪欏ソ鍍忔湁鐐硅窡C鐨勪笉鍚岋紙鐩稿弽錛夈?br />寮曞叆涓鐐瑰瀮鍦懼洖鏀舵満鍒剁殑鐭ヨ瘑
聽When you need a new object, Java allocates the required memory. When you are done with an object, the memory is reclaimed for you automatically via Java's garbage collection facility.
聽Garbage collection runs as a thread in the background, looking for objects that no longer have a usable reference. When it finds them, it destroys them and reclaims the memory.
聽The implementation of garbage collection varies between Java Virtual Machines. They generally follow the same process, however. First, the garbage collector gets a snapshot of all running threads and all loaded classes. Then, all objects that are referred to by this thread set are marked as current. The process stops when all objects that it is possible to reach have been marked and the rest have been discarded.
聽In order to help the Virtual Machine, it is a good idea to remove your references to unneeded objects. This is often done by simply setting your reference to null:
聽Test t = new Test();
聽t.someAction();
聽// all done
聽t = null;
灝忕粨錛?br />Stack: Primitive data types(primitive types), the addresses of objects(=references).
Heap:聽 objects.
===============================================
浠庣郴緇熺殑瑙掑害鐪?stack錛堟爤錛夊拰heap(鍫嗭級
Dynamic Data Structures: The Heap
A typical personal computer or workstation today has somewhere between 16 and 64 megabytes of RAM installed. Using a technique called virtual memory, the system can swap pieces of memory on and off the machine's hard disk to create an illusion for the CPU that it has much more memory, for example 200 to 500 megabytes. While this illusion is complete as far as the CPU is concerned, it can sometimes slow things down tremendously from the user's perspective. Despite this drawback, virtual memory is an extremely useful technique for "increasing" the amount of RAM in a machine in an inexpensive way. Let's assume for the sake of this discussion that a typical computer has a total memory space of, for example, 50 megabytes (regardless of whether that memory is implemented in real RAM or in virtual memory).
The operating system on the machine is in charge of the 50-megabyte memory space. The operating system uses the space in several different ways, as shown here:
聽
The operating system and several applications, along with their global variables and stack spaces, all consume portions of memory. When a program completes execution, it releases its memory for reuse by other programs. Note that part of the memory space remains unused at any given time.
This is, of course, an idealization, but the basic principles are correct. As you can see, memory holds the executable code for the different applications currently running on the machine, along with the executable code for the operating system itself. Each application has certain global variables associated with it. These variables also consume memory. Finally, each application uses an area of memory called the stack, which holds all local variables and parameters used by any function. The stack also remembers the order in which functions are called so that function returns occur correctly. Each time a function is called, its local variables and parameters are "pushed onto" the stack. When the function returns, these locals and parameters are "popped." Because of this, the size of a program's stack fluctuates constantly as the program is running, but it has some maximum size.
As a program finishes execution, the operating system unloads it, its globals and its stack space from memory. A new program can make use of that space at a later time. In this way, the memory in a computer system is constantly "recycled" and reused by programs as they execute and complete.
In general, perhaps 50 percent of the computer's total memory space might be unused at any given moment. The operating system owns and manages the unused memory, and it is collectively known as the heap. The heap is extremely important because it is available for use by applications during execution using the C functions malloc (memory allocate) and free. The heap allows programs to allocate memory exactly when they need it during the execution of a program, rather than pre-allocating it with a specifically-sized array declaration.
浣跨敤璇存槑錛?br />(1)瀵逛簬src\com\cjren\util\ClassA.java榪欎釜鎻愪緵緇欏叾浠栫被浣跨敤鐨刢lass.
package com.cjren.util;
public class ClassA {
聽 ...
}
緙栬瘧鏃?
javac -d . ClassA.java聽 // -d . 琛ㄧず浜嗕互褰撳墠鐩綍涓簆ackage璇彞鐢熸垚鐨勭浉瀵規牴鐩綍銆?br />緇撴灉鏄湪ClassA.java鎵鍦ㄧ殑鐩綍涓嬬敓鎴愪簡com.cjren.util鍖咃紝閲岄潰鍚獵lassA.class錛岃繖涓寘鍙互澶嶅埗鍓創鍒板叾浠栫殑鍦版柟渚涘叾浠栫被浣跨敤銆?br />Notes:
蹇呴』浣跨敤"-d ."錛屽惁鍒機lassA.class騫朵笉浼氭斁鍦╟om.cjren.util鍖呴噷闈紝鑰屾槸鐢熸垚鍦ㄥ拰ClassA.java鐩稿悓鐨勭洰褰曚笅銆?/p>
(2)瀵逛簬瑕佷嬌鐢–lassA鐨凜lassB.java.
import com.cjren.util.ClassA;
public class ClassB {
聽 ... // use ClassA here
}
To compile: javac ClassB.java
To run:聽聽聽聽 鍋囪com鍖呮斁鍦ㄥ拰ClassB.java鐨勫綋鍓嶇洰褰?br />聽聽聽聽聽聽聽聽聽聽聽 java ClassB聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽 // or java -cp . ClassB // here use the "-cp ." as the current directory to find the package com.
聽聽聽聽聽聽聽聽聽聽聽 鍋囪com鍖呮斁鍦―:\Program Files\Java\mypackages涓?br />聽聽聽聽聽聽聽聽聽聽聽 java -cp D:\Program Files\Java\mypackages ClassB
Notes:
閿欒涓錛?br />package com.cjren.util;
public class ClassA {
聽 ...
}
緙栬瘧鍚庣洿鎺ユ妸com.cjren.util鍖呴噷闈㈢殑ClassA.class鏂囦歡鎷瘋礉鍒板拰ClassB.java鐩稿悓鐨勭洰褰曚笅鐩存帴浣跨敤錛?br />public class ClassB {
聽 ... // use ClassA here
}
To compile: javac ClassB.java
閿欒淇℃伅鏄?br />"ClassB.java:鏌愪竴琛? 鏃犳硶璁塊棶 ClassA
聽閿欒鐨勭被鏂囦歡錛?.\ClassA.class
聽綾繪枃浠跺寘鍚敊璇殑綾伙細 com.cjren.util.ClassA
聽璇峰垹闄よ鏂囦歡鎴栫‘淇濊鏂囦歡浣嶄簬姝g‘鐨勭被璺緞瀛愮洰褰曚腑銆?
鎯充竴鎯充負浠涔堝嚭閿欎俊鎭槸璇達細鈥滈敊璇殑綾繪枃浠訛細 .\ClassA.class錛?綾繪枃浠跺寘鍚敊璇殑綾伙細 com.cjren.util.ClassA鈥濆憿錛熷洜涓?閿欒鐨勭被鏂囦歡錛?.\ClassA.class"褰撲腑鍖呭惈浜?閿欒鐨勭被錛?com.cjren.util.ClassA"榪欎釜淇℃伅錛岃岃繖涓?com.cjren.util.ClassA"鏄湪ClassA.java涓殑"package com.cjren.util;"璇彞鎵閫犳垚鐨勩?br />姝g‘鐨勫仛娉曟槸鎶奀lassA.class鎵鍦ㄧ殑鍖呮暣涓鍒剁矘璐村埌ClassB.java鎵鍦ㄧ殑鐩綍涓嬶紝鎴栬呭湪ClassB.java鎵鍦ㄧ殑鐩綍涓嬩漢涓烘墜鍔ㄧ殑寤虹珛com\cjren\util\鐩綍錛岀劧鍚庣洿鎺ユ妸ClassA.class鏂囦歡澶嶅埗綺樿創鍒版銆傝繖鏆楃ず浜嗕唬鐮佺敓鎴愮殑鍖呭拰鎵嬪姩寤虹珛鐨勭洰褰曞彲鑳芥槸涓鏍楓?br />鍙,褰揅lassA.java鐨勬簮浠g爜涓惈"package com.cjren.util;"璇彞錛屽垯鐢熸垚com.cjren.util鍖呴噷闈㈢殑ClassA.class鏂囦歡閲岄潰搴旇灝變篃鍖呭惈浜嗚嚜宸辮繖涓猚lass鏂囦歡鎵灞炵殑鍖呬俊鎭紝鎵浠ヨ繖涓狢lassA.class鍙兘鏀懼湪榪欎釜浠g爜涓凡緇忔寚瀹氱殑鐗瑰畾鍖呯殑璺緞涓嬩嬌鐢紝鑰屼笉鑳芥妸榪欎釜ClassA.class鐙珛鍑烘潵浣跨敤錛屽洜涓鴻繖鏍風殑璇濆皢ClassA.class鏂囦歡灞炴т腑鐨勭殑鍖呬俊鎭笉鐩哥銆傚綋鐒跺綋榪欎釜ClassA.java娌℃湁鏄懼紡鍦板埗瀹歱ackage璇彞淇℃伅鏃跺欙紝鎴戞鐤戯紙涔熻寰楀簲璇ワ級鏄粯璁ゅ湪ClassA.class鏂囦歡褰撲腑鍖呭惈浜嗗寘鐨勪俊鎭氨鏄?."錛屽彲浠ョ悊瑙d負榛樿鐨勫姞鍏ヤ簡"package .;"璇彞銆?/p>
閿欒浜岋細
public class ClassA {
聽 ...
}
緙栬瘧鍚庤繖涓狢lassA.class鏂囦歡涓惈鏈夌殑鍖呯殑淇℃伅鏄?."褰撳墠鐩綍灝卞寘錛?br />鎶婅繖涓狢lassA.class鏂囦歡錛岀Щ鍒頒互ClassB.java鎵鍦ㄧ殑鐩綍涓哄綋鍓嶇埗鐩綍鐨勪漢涓烘墜鍔ㄥ緩绔嬬殑com\cjren\util鐩綍涓嬨?br />import com.cjren.util.ClassA;
public class ClassB {
聽 ... // use ClassA here
}
To compile: javac ClassB.java
閿欒淇℃伅鏄?br />"ClassB.java:鏌愪竴琛? 鏃犳硶璁塊棶 com.cjren.swing.ClassA
聽閿欒鐨勭被鏂囦歡錛?.\com\cjren\util\ClassA.class
聽綾繪枃浠跺寘鍚敊璇殑綾伙細 ClassA
聽璇峰垹闄よ鏂囦歡鎴栫‘淇濊鏂囦歡浣嶄簬姝g‘鐨勭被璺緞瀛愮洰褰曚腑銆?
鎯充竴鎯充負浠涔堝嚭閿欎俊鎭槸璇達細鈥滈敊璇殑綾繪枃浠訛細 .\com\cjren\util\ClassA.class錛岀被鏂囦歡鍖呭惈閿欒鐨勭被錛?ClassA鈥濆憿錛熷洜涓轟綘榪欎釜com.cjren.util鍖呬腑鐨凜lassA.class鏂囦歡鏈潵鎵榛樿鐨勫寘淇℃伅鏄?."錛屽湪ClassA.java涓茍娌℃湁浣跨敤"package"璇彞鎸囧畾ClassA搴旇灞炰簬鍖卌om\cjren\util榪欎釜淇℃伅銆?/p>
灝忕粨錛?br />鍦ㄥ皾璇曡繃紼嬪綋涓彂鐜幫紝
public class ClassA {
聽 ...
}
鍜?br />package com.cjren.util;
public class ClassA {
聽 ...
}
榪欎袱涓彧宸簡涓涓猵ackage璇彞鐨刢lass鏂囦歡澶у皬鏈夊崄鍑犲埌鍑犲崄k涓婄殑鍖哄埆錛岃繖鍙兘榪涗竴姝ヨ瘉鏄庝簡.java鏂囦歡涓殑package璇彞浼氬湪.class鏂囦歡涓姞鍏ョ浉搴旂殑鍖呬俊鎭紝榪欎釜鍖呬俊鎭喅瀹氫簡榪欎釜class琚嬌鐢ㄦ椂鍊欑殑鏂瑰紡錛堟槸鍚﹂渶瑕乮mport鐗瑰畾鐨勫寘錛夈?br />榪樻湁涓鐐硅娉ㄦ剰鐨勬槸錛?br />package com.cjren.util;
public class ClassA {
聽 ...
}
涔嬪悗鏃犺鏄嬌鐢?javac ClassA.java 鎴栬?javac -d . ClassA.java緙栬瘧閮戒笉浼氬獎鍝岰lassA.class鏂囦歡褰撲腑鎵鍚湁鐨勫寘淇℃伅錛岃繖涓ょ緙栬瘧鏂瑰紡鎵閫犳垚鐨勫尯鍒湪涓婇潰鐨勪嬌鐢ㄨ鏄庝腑宸茬粡璇磋繃浜嗐?/p>
聽
灝濊瘯浠ヤ竴涓緥瀛愭潵璇存槑鎼緩涓涓?/span> project 鏃跺欑殑鐩綍鏋勫緩鎯呭喌銆?/span>
鎯呭喌涓
涓嬮潰浠ヤ竴涓湴鍥劇紪杈戝櫒鐨勪緥瀛愪負渚?/font>
鐖剁洰褰曟槸
鈥漰roject mapeditor鈥?
.\Image 錛?/span> 紼嬪簭浣跨敤鍒扮殑鍥劇墖銆?/span>
.\Maps 錛?/span> 紼嬪簭榪愯鏃剁敤鎴蜂繚瀛樼殑鑷畾涔夊湴鍥俱?/span>
.\com 錛?/span> 涓葷▼搴?/span> MapEditor.java 灝嗕細鏄敤鍒扮殑 package 鐨勬簮鏂囦歡銆?/span>
.\com\cjren\swing\MyFilter.java
MapEditor.java 錛?/span> 涓葷▼搴忔簮鏂囦歡錛屼唬鐮佷腑娌℃湁 鈥漰ackage鈥?/span> 璇彞銆?/span>
runMapEditor.bat 錛?/span> 瀹屾垚緙栬瘧鍜岃繍琛屾墍闇鐨勬墍鏈夊伐浣溿?/span>
涓嬮潰涓昏鐪嬬湅 runMapEditor.bat 鐨勫唴瀹癸細
@echo off
rem output the date and time
date /T
time /T
echo welcome to my map editor :-)
rem make the directory for class files
mkdir .\build\classes
rem compile the source files
javac -d .\build\classes MapEditor.java
rem run the application,
rem but you must avoid this: java.\build\classes\MapEditor,
rem which will be an error
java -cp .\build\classes MapEditor
rem clean everything in the build folder
rmdir .\build /S /Q
pause
浠庝笂闈㈢殑鍏蜂綋浠g爜涓彲浠ョ湅鍑哄湪緙栬瘧鍜岃繍琛岀殑鏃跺欙紝鎵鏈夌殑 class 鏂囦歡閮藉洖琚斁鍦?/span> .\build\classes 榪欎釜鏂囦歡澶逛腑錛岃繖涓枃浠跺す鏄姩鎬佺敓鎴愬茍涓旀渶鍚庝細琚竻妤氭帀鐨勩?/span>
榪欓噷鏈変笁涓煎緱娉ㄦ剰鐨勫湴鏂廣?/span>
涓錛岄氳繃 鈥?javac -d .\build\classes MapEditor.java鈥?/span> 錛屼笉鍗曞彧鏄?/span> MapEditor.java 鎵瀹氫箟鐨?/span> class 閮借鏀句簬 .\build\classes 涓紝鐢氳嚦榪?/span> .\com 涓?/span> MyFilter.java 鎵瀵瑰簲鐨?/span> class 涔熼兘鍦?/span> .\build\classes\com\cjren\swing 涓紝鑰?/span> com 鍖呭湪 .\bulid\classes 涓嬫槸鑷姩琚噯紜敓鎴愮殑銆備篃灝辨槸璇存墍鏈夌殑 .class 鏂囦歡閮借鏀懼湪 .\bulid\classes 鏂囦歡澶逛腑浜嗐?/span>
浜岋紝褰撲嬌鐢?/span> 鈥漥ava -cp .\build\classes MapEditor鈥?/span> 鏉ヨ繍琛岀▼搴忕殑鏃跺欙紝騫舵病鏈夊洜涓?/span> Image 鏂囦歡澶逛笉鍦?/span> .\build\classes 鑰屽嚭閿欍傝繖璇存槑浜?/span> .java 鏂囦歡涓殑浠g爜宸茬粡鍐沖畾浜嗗畠鎵浣跨敤鍒扮殑 Image 鏂囦歡澶圭殑浣嶇疆錛岃繖涓綅緗槸鐩稿浜?/span> .java 鏂囦歡鎵鍦ㄧ殑浣嶇疆鏉ヨ鐨勶紝鑰屼笉鏄?/span> .class 銆?/span>
涓夛紝鎴戝皾璇曚簡鍦?/span> d 鐩樹笅鏂板緩浜嗕竴涓?/span> a 鐩綍錛岀劧鍚庢妸
javac -d .\build\classes MapEditor.java
java -cp .\build\classes MapEditor
鎹㈡垚
javac -d d:\a MapEditor.java
java -cp d:\a MapEditor
涔嬪悗錛屽叾浠?/span> 鈥漰roject mapeditor鈥?/span> 涓嬬殑鎵鏈変笢瑗塊兘娌℃湁鏀瑰彉錛岀▼搴忎緷鐒舵垚鍔熸墽琛屻傝繖灝辮繘涓姝ヨ瘉鏄庝簡 .java 鏂囦歡涓殑浠g爜鍐沖畾浜嗘墍鏈夊叾浠栫洰褰曟垨鏂囦歡鍏冪礌鐨勭浉瀵逛綅緗紝榪欎釜浣嶇疆浠?/span> .java 鏂囦歡鎵鍦ㄧ殑鐩綍涓烘爣鍑嗐傝屼笌 .class 鏂囦歡鐨勮礬寰勬棤鍏熾備絾鏄細鍒販娣嗕簡 A.class 瀹冩墍浣跨敤鍒扮殑鍖呯殑 .class 鐨勮礬寰勬槸浠?/span> A.class 鏂囦歡鐨勮礬寰勪負鏍囧噯鐨勶紒錛侊紒榪欏氨涓庝笂闈?/span> MapEditor.class 涔熷拰錛堝繀欏誨拰錛?/span> com 鍖呭悓澶勪簬 bulid\classes 鐩綍涓嬫病鏈夌煕鐩俱?/span>
鎯呭喌浜?/span>
鐩殑鏄妸涓婇潰鎯呭喌涓涓墍鏈夌殑鏂囦歡鍜屾枃浠跺す閮藉寘鍚湪 src 榪欎釜鏂囦歡澶逛腑錛岃?/span> src 鏈韓灝辨槸鐖剁洰褰?/span> project mapeditor2 涓嬬殑涓涓枃浠跺す銆傝屼笖鎴戝笇鏈涚紪璇戞椂鍊欑敓鎴愮殑 build 鏂囦歡澶瑰拰 src 鏂囦歡澶圭殑鍏崇郴鏄細
\project mapeditor2\src
\project mapeditor2\build
src
鏂囦歡澶圭殑鍐呭濡備笅錛?/span>
娉ㄦ剰鎵瑰鐞嗘枃浠?/span>
runMapEditor.bat
鍦?/span>
src
鏂囦歡澶逛笅錛岃屼笖鍦ㄦ鎯呭喌涓嬶紝
runMapEditor.bat
鐨勫唴瀹瑰皢鏈夋墍鍙樺寲錛?/span>
@echo off
rem output the date and time
date /T
time /T
echo welcome to my map editor :-)
rem make the directory for class files
mkdir ..\build\classes
rem compile the source files
javac -d ..\build\classes MapEditor.java
rem run the application,
rem but you must avoid this: java.\build\classes\MapEditor,
rem which will be an error
java -cp ..\build\classes MapEditor
rem clean everything in the build folder
rmdir ..\build /S /Q
pause
鎯呭喌涓鍜屾儏鍐典簩鐨勫樊鍒笉澶э紝鍙槸婧愪唬鐮佹枃浠跺涓灞傜殑鏂囦歡澶圭殑鍖呰9銆傝屼笖鏈澶х殑鍏卞悓鐐規槸 runMapEditor.bat 鍜屾簮浠g爜鏂囦歡鍦ㄥ悓涓涓枃浠跺す涓嬨?/span>
鎯呭喌涓?/span>
灝濊瘯鍦ㄦ儏鍐典簩鐨勫熀紜涓婃妸 runMapEditor.bat 鎻愬埌鍜?/span> src 浠ュ強 build 鐩稿悓鐨勭埗鐩綍涓嬨傚亣璁劇埗鐩綍鏄?/span> project mapeditor3 錛屽垯錛?/span>
鐜板湪
runMapEditor.bat
鐨勫唴瀹規槸錛?/span>
@echo off
rem output the date and time
date /T
time /T
echo welcome to my map editor :-)
rem make the directory for class files
mkdir .\build\classes
rem go into the src directory
cd src
rem compile the source files
javac -d ..\build\classes MapEditor.java
rem run the application,
rem but you must avoid this: java.\build\classes\MapEditor,
rem which will be an error
java -cp ..\build\classes MapEditor
rem clean everything in the build folder
rmdir ..\build /S /Q
pause
鍦ㄥ皾璇曞伐紼嬪綋涓紝鍙戠幇浠ヤ笅鐨勫仛娉曞皢鎵句笉鍒?/span> Image 鏂囦歡澶癸細
cd src
javac -d ..\build\classes MapEditor.java
cd ..
java -cp .\build\classes MapEditor
榪欑淇敼鎵閫犳垚鐨勫尯鍒槸榪愯 鈥漥ava鈥?/span> 鍛戒護鐨勪綅緗笉鍚屼簡銆傚彲浠ョ寽鎯蟲槸闇瑕佸湪 src 鏂囦歡澶瑰唴榪愯 java 鍛戒護錛岃?/span> src 鏂囦歡澶逛腑鍚湁鎵鏈夌▼搴忔墍闇鐨勪唬鐮佸拰 image 绱犳潗銆?/span>
涓嬮潰鎻愪緵涓涓◢寰笉鍚岀殑鎵瑰鐞嗘枃浠訛紝 runMapEditor2.bat 錛屽畠涔熷悓鏍峰浜?/span> project mapeditor3 榪欎釜鐖剁洰褰曚笅錛?/span>
runMapEditor2.bat
鐨勫唴瀹瑰涓嬶細
@echo off
mkdir d:\a
cd src
javac -d d:\a MapEditor.java
java -cp d:\a MapEditor
rmdir d:\a /S /Q
pause
榪欎釜淇敼榪囩殑渚嬪瓙鎶?/span> class 鏂囦歡閮界Щ鍒拌緝榪滅殑鍦版柟 (d:\a) 錛屼絾鏄繕鍙互鎴愬姛榪愯銆傚皬緇撲竴涓嬪畠鑳芥垚鍔熻繍琛岀殑鐗圭偣錛?/span>
涓錛?/span> src 鏂囦歡澶逛腑宸茬粡鍖呭惈浜嗘墍鏈夌殑鍏冪礌錛屽寘鎷墍闇鐨勫閮?/span> package 浠g爜錛屽寘鎷?/span> image 鏂囦歡澶廣傝繖浜涘厓绱犻兘蹇呴』浣垮緱涓葷▼搴?/span> .java 鑳芥垚鍔熺殑緙栬瘧銆?/span>
浜岋紝榪愯 鈥漥ava鈥?/span> 鍛戒護閮藉湪 src 榪欎釜鐩綍涓嬨備篃灝辨槸璇撮兘鍦ㄥ拰浠g爜澶勫湪鐩稿悓鐨勬枃浠惰礬寰勪笅錛岃屼笉鏄叾浠栦換浣曡礬寰勩?/span>
鎯呭喌涓閮戒笁鐨勫皬緇?/span>
鍩烘湰婊¤凍浜嗗湪 windows 緋葷粺涓嬪紑鍙戝皬欏圭洰鐨勯渶姹傦紝鎴戝湪榪欎笁涓皾璇曠殑渚嬪瓙涓富紼嬪簭 MapEditor.java 閮芥病鏈夊惈鏈?/span> 鈥漰ackage main鈥?/span> 榪欑被鐨勬墦鍖呰鍙ャ?/span>