Java±ä³¤²ÎÊý
ÔÚJava5ÖÐÌṩÁ˱䳤²ÎÊý£¬Ò²¾ÍÊÇÔÚ·½·¨¶¨ÒåÖпÉÒÔʹÓøöÊý²»È·¶¨µÄ²ÎÊý£¬¶ÔÓÚͬһ·½·¨¿ÉÒÔʹÓò»Í¬¸öÊýµÄ²ÎÊýµ÷Óã¬ÀýÈ磺print("hello");print("hello","lisi");print("hello","ÕÅÈý");ÏÂÃæ½éÉÜÈçºÎ¶¨Òå¿É±ä³¤²ÎÊýÒÔ¼°ÈçºÎʹÓÿɱ䳤²ÎÊý¡£
1¡¢¿É±ä³¤²ÎÊý·½·¨µÄ¶¨Òå
ʹÓÃ...±íʾ¿É±ä³¤²ÎÊý£¬ÀýÈç
print(String... args){
...
}
ÔÚ¾ßÓпɱ䳤²ÎÊýµÄ·½·¨ÖпÉÒ԰ѲÎÊýµ±³ÉÊý×éʹÓã¬ÀýÈç¿ÉÒÔÑ»·Êä³öËùÓеIJÎÊýÖµ¡£
print(String... args){
for(String temp:args)
System.out.println(temp);
}
2¡¢¿É±ä³¤²ÎÊýµÄ·½·¨µÄµ÷ÓÃ
µ÷ÓõÄʱºò¿ÉÒÔ¸ø³öÈÎÒâ¶à¸ö²ÎÊý£¬ÀýÈ磺
print("hello");
print("hello","lisi");
print("hello","ÕÅÈý");
3¡¢×¢ÒâÊÂÏî
3.1 ÔÚµ÷Ó÷½·¨µÄʱºò£¬Èç¹ûÄܹ»ºÍ¹Ì¶¨²ÎÊýµÄ·½·¨Æ¥Å䣬ҲÄܹ»Óë¿É±ä³¤²ÎÊýµÄ·½·¨Æ¥Å䣬ÔòÑ¡Ôñ¹Ì¶¨²ÎÊýµÄ·½·¨¡£¿´ÏÂÃæ´úÂëµÄÊä³ö£º
package ch6;
import static java.lang.System.out;
public class VarArgsTest {
public static void main(String[] args) {
VarArgsTest test = new VarArgsTest();
test.print("hello");
test.print("hello","zhangsan");
}
public void print(String... args){
for(int i=0;i<args.length;i++){
out.println(args[i]);
}
}
public void print(String test){
out.println("----------");
}
}
3.2 Èç¹ûÒªµ÷Óõķ½·¨¿ÉÒÔºÍÁ½¸ö¿É±ä²ÎÊýÆ¥Å䣬Ôò³öÏÖ´íÎó£¬ÀýÈçÏÂÃæµÄ´úÂ룺
package ch6;
import static java.lang.System.out;
public class VarArgsTest {
public static void main(String[] args) {
VarArgsTest test = new VarArgsTest();
test.print("hello");
test.print("hello","zhangsan");
}
public void print(String... args){
for(int i=0;i<args.length;i++){
out.println(args[i]);
}
}
public void print(String test,String...args ){
out.println("----------");
}
}
¶ÔÓÚÉÏÃæµÄ´úÂ룬main·½·¨ÖеÄÁ½¸öµ÷Óö¼²»ÄܱàÒëͨ¹ý¡£
3.3 Ò»
Ïà¹ØÎĵµ£º
×î½ü¹«Ë¾Åöµ½ÐèÒªÓÃͼ±íµÄÐÎʽÏÔʾһЩÊý¾Ý£¬ÎҾͿªÊ¼µ½ÍøÉϲéѯ£¬²éµ½ÁËjfreechartºÍamcharts,ÕâÁ½ÕßÎÒ¶¼ÊµÏÖ¹ýÁË£¬jfreechart×îºóÉú³ÉͼƬ£¬µ«ÊÇͼƬЧ¹û²»ÊÇÎÒÏëÒªµÄ£¬È»ºóÓÖÑо¿amcharts ËüµÄЧ¹ûȷʵºÜºÃ£¬¶øÇÒ¹Ù·½ÍøÕ¾ÉÏ»¹ÓкÃЩÀý×ӿɹ©ÏÂÔØ£¬ÍøÖ·ÊÇ:www.amcharts.com
£¨ÏëÒªÍê³ÉÒ»¸öamchartsͼÐÎÐèÒªswfobjects. ......
Spring Framework ¡¾Java¿ªÔ´ J2EE¿ò¼Ü¡¿
Spring ÊÇÒ»¸ö½â¾öÁËÐí¶àÔÚJ2EE¿ª·¢Öг£¼ûµÄÎÊÌâµÄÇ¿´ó¿ò¼Ü¡£ SpringÌṩÁ˹ÜÀíÒµÎñ¶ÔÏóµÄÒ»Ö·½·¨²¢ÇÒ¹ÄÀøÁË×¢Èë¶Ô½Ó¿Ú±à³Ì¶ø²»ÊǶÔÀà±à³ÌµÄÁ¼ºÃÏ°¹ß¡£SpringµÄ¼Ü¹¹»ù´¡ÊÇ»ùÓÚʹÓÃJavaBeanÊôÐ﵀ Inversion of ControlÈÝÆ÷¡£È»¶ø£¬Õâ½ö½öÊÇÍêÕûͼ¾°ÖеÄÒ»²¿·Ö£ºSpringÔÚÊ¹Ó ......
ͨ³£Çé¿öÏ£¬ÎÒÃÇÔÚ±àдjavaÎļþʱ£¬»áÓÐÒýÓõ½×ÔÒѶ¨ÒåµÄһЩÀ࣬Èç¹û°´Í¨³£µÄjavac *.javaµÄÐÎʽÀ´±àÒë»á³öÏÖÕÒ²»µ½·ûºÅµÄ´íÎó¡£
ÒÔÏÂÌṩÁËÁ½ÖÖ·½·¨£¬ÒÔ¹©²Î¿¼
¼ÙÈçÔÚd:\web\wshÏÂÓÐa.javaºÍb.javaÁ½¸öÎļþ£¬ÔÚb.javaÎļþÖÐÓÐÒýÓÃÁËa.java¡£ÏÂÃæÊDZàÒëµÄ·½·¨
·½·¨Ò»:
½øÈëd:\web\wshÏ£º javac a.java
È»ºóÍ˳öwshÄ ......
Ä¿Ç°ºÜ¶àѧÉúÃæÁÙמÍÒµµÄÎÊÌ⣬µ±È»£¬ÏñÎÒÒ»ÑùµÄ¸Õ±ÏÒµµÄ´óѧÉúÒ²²»ÀýÍâ¡£´óѧʱѧµÄÊǼÆËã»úרҵµÄ£¬´óѧËÄÄê×ÜÒÔΪ°Ñרҵ¿ÎѧºÃ£¬±ÏÒµÁ˾ͿÉÒÔÕÒµ½Ò»·Ý²»´íµÄ¹¤×÷¡£
¿ÉÊǼ¸¸öÔÂÃæÊԵĽÓÁ¬Åö±Ú£¬Ê¹ÎҸе½´óѧÀïѧµÄרҵ֪ʶÀíÂÛÐÔÌ«Ç¿£¬Êµ¼Ê ......
¡¾×ª¡¿JavaÖеÄλÔËËã·û
Ô×÷ÕߣºRosen Jiang ³ö´¦£ºhttp://www.blogjava.net/rosen
ÒÆλÔËËã·û
°üÀ¨£º
“>> ÓÒÒÆ”£»“<< ×óÒÆ”£»“>>> ÎÞ·ûºÅÓÒÒÆ”
Àý×Ó£º
-5>>3=-1
1111 1111 1111 1111 1111 1111 1111 ......