ʹÓÃEclipseÓëAnt½øÐÐjava³ÌÐò¿ª·¢
ÏàÐÅ´ó¼ÒÒѾ¶ÔEclipseµÄʹÓÃÓÐÒ»¶¨µÄ¾Ñé,ÔÚ±àдjavaÔ´´úÂëÊǼþÌý×ÔºÀµÄÊÂ,´óÒª±àÒëÒ»´óÅújavaÔ´´úÂëȴʵ¼ù±È½Ï¿àÄÕµÄÊÂÇé,Èç¹ûÒ»¸öÒ»¸öµã"run"È¥±àÒëʵÔÚÌ«ÀË·Ñʱ¼äÁË.ÏëÍÑÀë"¿àº£",ÏÖÔھ͸ú×ÅżÃÇÒ»Æë×ß°É,²½ÈëAntµÄʹÓÃÀú³Ì.
1.°²×°Ant
a.ʹÓÃEclipse.3.2°æ±¾×Ô´øµÄAnt¿ÉÒÔÊ¡È¥°²×°µÄÂé·³,ĬÈϰ汾ʱAnt-1.6.5,ÏÖÔÚ×îеÄAntÊÇ1.7.0
b.ÊÖ¹¤°²×°Ant,ÔÚhttp://ant.apache.orgÉÏÏÂÔØ×îеÄant-1.7.0
½âѹµ½ÈÎÒâĿ¼ÏÂ,ÉèÖÃpathÓëclasspathÒÔ¼°ANT_HOME,Ö®ºó¾Í¿ÉÒÔÔÚÃüÁîÐÐģʽÏÂÔËÐÐantÁË.
(¸öÈ˽¨Ò黹ÊÇÈ¥¹ÙÍøÏÂÔØÒ»¸ö×îаæµÄAnt,ÒÔΪeclipseÖÐÒÔ²å¼þÐÎʽĬÈÏ°²×°µÄantͨ³£Ã»ÓÐdoc,ϸöant-1.7.0,¿´¿´ÀïÃæµÄdoc¶ÔÏêϸµÄѧϰantÊǺÜÓÐÓõÄ)
2.simple¿ª·¢ÊµÀý
a.ÔÚeclipseн¨Ò»¸öprojectÃûΪHelloWorld,ÔÚsrcĿ¼ÏÂн¨Ò»¸öÃûΪhelloworldµÄpackage.
b.ÔÚhelloworld°üÖÐ,н¨Ò»¸öÀà,ÃûΪHelloWorld
Ô´ÂëÈçÏÂ:
package helloworld;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("HelloWorld");
}
}
3.н¨build.xmlÎļþ
AntÓëMakeÊDZȽÏÏàËƵÄÁ½¸ö¹¤¾ß,makeÔÚĿ¼ÖÐÑ°ÕÒÃûΪmakefileµÄÎļþ½øÐÐÖ¸¶¨µÄ²Ù×÷,¶øAntÔòÑ°ÕÒÃûΪbuild.xmlÎļþ.
²åÇú:AntûÓÐ×Ô¼ºµÄ×Ô¶¨ÒåÓïÑÔ,µ«Éú³ÉµÄÎļþÊÇÓÃxml±àдµÄ,´æÔÚ×ÅÒ»×éAntÄܹ»Àí½âʶ±ð½âÎöµÄÔ¤¶¨ÒåxmlÔªËØ,Èç<project>,<target>,<javac>,<jar>µÈµÈ
build.xmlÎļþÄÚÈÝÈçÏÂ:
<?xml version="1.0"?>
<!--¶¨ÒåprojectÎļþµÄÎļþÃûÓëĬÈÏÖ´ÐÐÄ¿±ê-->
<project default="dist" name="Project Argon">
<!--Ìí¼ÓÃèÊö-->
<description>A simple Java project</description>
<!--Ìí¼ÓÊôÐÔ,Ï൱ÓÚÎļþ¼¶µÄÈ«¾Ö±äÁ¿,´Ë´¦ÓÃÓÚÉèÖÃĿ¼Ã
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
1.[http://www.javaalmanac.com] Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] OReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í.
4.[http://www.developer.com/java] ......
1¡¢×Ö·û´®³¤¶È
String s1 = "ÎÒÊÇÖйúÈË";
String s2 = "imchinese";
String s3 = "imÖйúÈË";
System.out.println(s1+":"+new String(s1).length());
System.out.println(s2+":"+new String(s2).length());
System.out.println(s3+ ......
package Pack;
import java.text.*;
import java.util.*;
import java.text.DecimalFormat;
import java.util.*;
public class Test {
/**
* @param args
*/
public static void main(String args[]) {
yuesef(50,3);
}
public static void yuesef(int n, int m) {
ArrayList<Integer ......
ÃüÃû¹æ·¶
¶¨ÒåÕâ¸ö¹æ·¶µÄÄ¿µÄÊÇÈÃÏîÄ¿ÖÐËùÓеÄÎĵµ¶¼¿´ÆðÀ´ÏñÒ»¸öÈËдµÄ£¬Ôö¼Ó¿É¶ÁÐÔ£¬¼õÉÙÏîÄ¿×éÖÐÒòΪ»»È˶ø´øÀ´µÄËðʧ¡££¨ÕâЩ¹æ·¶²¢²»ÊÇÒ»¶¨Òª¾ø¶Ô×ñÊØ£¬µ«ÊÇÒ»¶¨ÒªÈóÌÐòÓÐÁ¼ºÃµÄ¿É¶ÁÐÔ£©
Package µÄÃüÃû
Package µÄÃû×ÖÓ¦¸Ã¶¼ÊÇÓÉÒ»¸öСдµ¥´Ê×é³É¡£
Class µÄÃüÃû
Class µÄÃû×Ö±ØÐë ......