˵һÏÂJavaÀïÃæµÄ·¾¶ÎÊÌ⣬CLASSPATHºÍSOURCEPATH
javaµÄ·¾¶ÈÃÐí¶àÈË£¬ÌرðÊdzõѧÕ߸е½ÃÔ»ó£¬ÎÒÕâÀïÔÙ½âÊÍһϡ£ÎÒÃÇ·Ö2¸ö½×¶Î£¬1ÊDZàÒë½×¶Î£¬2ÊÇÔËÐн׶Ρ£
Ò»¡¢±àÒë½×¶Î
Õâ¸öʱºò£¬ÎÒÃÇÒªÌṩ¸ø±àÒëÆ÷µÄÓÐ2¸ö·¾¶²ÎÊý£¬µÚÒ»¸öÊÇÔ´´úÂëÔÚÄÄÀҲ¾ÍÊÇ sourcepath,µÚ¶þ¸ö¾ÍÊÇÒÀÀµµÄÀàÔÚÄÄÀҲ¾ÍÊÇ classpath
ÎÒÃÇ¿´Ò»¸öÀý×Ó
d:\temp\TestCP\d1\p1\Class1.java
view plaincopy to clipboardprint?
package p1;
public class Class1 {
public void show(){
System.out.println("Class1");
}
}
package p1;
public class Class1 {
public void show(){
System.out.println("Class1");
}
}
d:\temp\TestCP\d2\p2\Class2.java
view plaincopy to clipboardprint?
package p2;
import p1.Class1;
public class Class2 {
public static void main(String[] args){
Class1 c1 = new Class1();
c1.show();
}
}
package p2;
import p1.Class1;
public class Class2 {
public static void main(String[] args){
Class1 c1 = new Class1();
c1.show();
}
}
±àÒëµÄʱºò£¬ÎÒÃÇÏÈÔÚ d:\temp\testCP\d1 ±àÒëClass1
D:\temp\testCP\d1>javac p1\Class1.java
±àÒë³É¹¦
È»ºóÎÒÃÇÔÚ d:\temp\testCP\d2 ϱàÒë Class2¡£ÓÐ2¸ö·½·¨½øÐбàÒ룺
µÚÒ»£ºÖ¸¶¨Ô´Îļþ sourcepath
D:\temp\testCP\d2>javac -sourcepath .;../d1 p2\Class2.java
µÚ¶þ£ºÖ¸¶¨classpath
D:\temp\testCP\d2>javac -sourcepath . -cp ../d1 p2\Class2.java
Á½¸ö·½·¨¶¼ÄÜ´ïµ½ÎÒÃÇÐèÒªµÄЧ¹û¡£Ò²¾ÍÊÇ˵£¬ÔÚ·¾¶Àϵͳ»áÔÚÆäÏÂÃæ¸ù¾Ýpackage×Ô¶¯Ñ°ÕÒÔ´Îļþ»òÕßclassÎļþµÄ¡£
ÁíÒ»¸öÇé¿ö£¬Èç¹ûÎÒÃÇÐèҪij¸öÀà¿âµÄÖ§³Ö£¬±ÈÈçjarÎļþ£¬ÄÇôÎÒÃǾͲ»ÄÜÖ»°üº¬Â·¾¶¾ÍÐÐÁË£¬¶øÊÇÓ¦¸Ã°üº¬Õû¸ö·¾¶ºÍÎļþÃû£¬±ÈÈç
D:\temp\testCP\d2>javac -sourcepath . -cp ../d1;d:/lib/spring.jar p2\Class2.java
µÚ¶þ¡¢ÔÚÔËÐÐʱ
ÎÒÃÇÐèÒªÖ¸¶¨ÆäËûµÄclassÔÚÄÄÀÒÔ¼°ÎÒÃÇÐèÒªµÄÀà¿âÔÚÄÄÀËùÒÔÔËÐÐÃüÁîÓ¦¸ÃÊÇ
D:\
Ïà¹ØÎĵµ£º
Java
ƽ̨ÒÑÎÞ´¦²»ÔÚ£¬Java EE¡¢Java SE¡¢Java ME ºÍ Java Card£¬Java
µÄ·¢Õ¹ÎªÎÞÊý³ÌÐòÔ±ÌṩÁ˹¤×÷»ú»á£¬¶¼ÊÇ“Java”£¬È»¶ø³ýÁË»ù±¾µÄ Java
Óï·¨´ó¶¼Ò»ÖÂÍ⣬³ÌÐòÔ±±ØÐë»ùÓÚ²»Í¬µÄƽ̨Óв»Í¬µÄ¿¼ÂÇ£¬Ñ§Ï°²»Í¬Æ½Ì¨µÄÌØµã£º
²»Í¬Æ½Ì¨µÄ»·¾³
Java EE ËùÔËÐеÄÓ²¼þ·þÎñÆ÷¡¢²Ù×÷ϵͳ£¬Java SE ËùÔÚ PC »ú ......
´ó¼ÒÔÚÈ¥²Î¼ÓÃæÊÔµÄʱºò£¬¾³£»áÓöµ½ÕâÑùµÄ¿¼Ì⣺¸øÄãÁ½¸öÀàµÄ´úÂ룬ËüÃÇÖ®¼äÊǼ̳еĹØÏµ£¬Ã¿¸öÀàÀïÖ»Óй¹ÔìÆ÷·½·¨ºÍһЩ±äÁ¿£¬¹¹ÔìÆ÷Àï¿ÉÄÜ»¹ÓÐÒ»¶Î´úÂë¶Ô±äÁ¿Öµ½øÐÐÁËijÖÖÔËË㣬ÁíÍ⻹ÓÐһЩ½«±äÁ¿ÖµÊä³öµ½¿ØÖÆÌ¨µÄ´úÂ룬ȻºóÈÃÎÒÃÇÅжÏÊä³öµÄ½á¹û¡£Õâʵ¼ÊÉÏÊÇÔÚ¿¼²éÎÒÃǶÔÓڼ̳ÐÇé¿öÏÂÀàµÄ³õʼ»¯Ë³ÐòµÄÁ˽⡣
ÎÒÃÇ´ó¼ ......
ÍÜÍÜÍÆ¼ö£ºÍÜÍܽÌÄãÎı¾¾ÛÀà
ÕªÒª£ºÎı¾¾ÛÀàÊÇËÑË÷ÒýÇæºÍÓïÒåwebµÄ»ù±¾¼¼Êõ£¬Õâ´Î±¾Íܺʹó¼ÒÒ»Æðѧϰһϼòµ¥µÄÎı¾¾ÛÀàËã·¨£¬¿ÉÄܲ»ÄÜÖ±½ÓÓÃÓÚʵ¼ÊÓ¦ÓÃÖУ¬µ«¶ÔÓÚÏëѧËÑË÷¼¼ÊõµÄ³õѧÕß»¹ÊÇÓÐÒ»¶¨ÈëÃÅ×÷Óõġ£ÕâÀï»áÓõ½TF/IDFÈ¨ÖØ£¬ÓÃÓàÏҼнǼÆËãÎı¾ÏàËÆ¶È£¬Ó÷½²î¼ÆËãÁ½¸öÊý¾Ý¼äŷʽ¾àÀ룬ÓÃk-means½øÐÐÊý¾Ý¾ÛÀàµÈÊýѧ ......
1.ÉùÃ÷Êý×éÒýÓñäÁ¿Ê±²»ÄÜÖ¸¶¨Êý×éµÄ³¤¶È¡£È磺int x[1];Õâ¾ä»°·Ç·¨¡£
2.Êý×é¶ÔÏóµÄ´´½¨£¬ÀýÈ磺
int [] scores = new int[100];
Ê×ÏÈÔÚ¶ÑÖзÖÅäÄÚ´æ¿Õ¼ä£¬ÉÏÊöµÄ¾ÍÊÇ400¸ö×Ö½Ú£¬È»ºó¾Í¸øÆä¸³Ä¬ÈÏÖµ£¬¸÷¸öÊý¾ÝÀàÐ͵ÄĬÈÏÖµ²»Í¬£¬intΪ0.
3.·µ»ØÊý×é¶ÔÏóµÄÒýÓãº
int [] x =new int [10]; <=> int size = 10; i ......