Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Array»òArrayCollection×÷Ϊjava·½·¨²ÎÊý

/*===================MXML´úÂë==================*/
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Button label="²âÊÔArray" click="bk()"/>

<mx:Script>
<!--[CDATA[
import mx.collections.ArrayCollection;
private function bk():void{
var arrCol:ArrayCollection=new ArrayCollection();//arrayCollection ×÷Ϊ²ÎÊý
var arr:Array=[];//Array×÷Ϊ²ÎÊý

for(var i:int=0;i<10;i++){
arrCol.addItem(i);
}

for(var j:int=0;j<10;j++){
arr.push(j);
}
dbiz.testArrayCol(arrCol);
dbiz.testArray(arr);
}
]]-->
</mx:Script>

<mx:RemoteObject id="dbiz" destination="departBiz" showBusyCursor="true">
<mx:method name="testArray"/>
<mx:method name="testArrayCol"/>
</mx:RemoteObject>
</mx:Application>
/*=================JAVA´úÂë=================*/
/*ʹÓÃArrayList ½ÓÊÕflex ´«À´µÄArray»òArrayCollection*/
public void testArray(ArrayList list){
System.out.print("(");
for (int i = 0; i < list.size()-1; i++) {
System.out.print("'"+list.get(i)+"',");
}
System.out.print("'"+list.get(list.size()-1)+"'");
System.out.println(")");
}
/*ʹÓÃList ½ÓÊÕflex ´«À´µÄArrayCollection»òArray*/
public void testArrayCol(List list){
System.out.print("(");
for (int i = 0; i < list.size()-1; i++) {
System.out.print("'"+list.get(i)+"',");
}
System.out.print("'"+list.get(list.size()-1)+"'");
System.out.println(")");
}


Ïà¹ØÎĵµ£º

JavaµÚ¶þ´ÎÉÏ»ú£¨ÕýÔò±í´ïʽ£©

±àдһ¸ö³ÌÐò£¬ÅжÏÒ»¸ö×Ö·û´®ÊÇ·ñÊǺϷ¨µÄJava±êʶ·û£»
//create string
import java.util.regex.*;
public class Split {
public static void main (String[] args) {
Pattern pattern = Pattern.compile("[,]");
String[] arrStr = pattern.split("abstract,break,byte,boole ......

java ¶ÔdoubleµÄ ÓÐȤ´¦Àí £¨j»ù p30£©

ºÜÖǻۣ¬ÆÄÓÐÊýѧÖÐÎÞÇî·ÖÎöµÄÒâζ
Õæ°®ËÀjavaÁË
public class FunnyNumbers {
public static void main(String[] args) {
double largeNum = (int)Math.exp(4000.0);
//int ²»Äܳý0
//Exception in thread "main" java.lang.ArithmeticException: / by zer oat FunnyNumbers.main(FunnyNumbers.j ......

java·ÖÒ³´úÂëÓÃÓÚjsp¼°java²¢´øÓвâÊÔ·½·¨


import java.util.ArrayList;
import java.util.List;
public class FenYe
{
     static double allpage=0; //×ÜÒ³Êý
     static double currpage=0; //µ±Ç°Ò³
     static double pagesize=10; //ÏÔʾÐÐ
     static int sta ......

һƪ²»´íµÄ½éÉÜJava Socket±à³ÌµÄÎÄÕÂ

 
ÊÂʵÉÏÍøÂç±à³Ì¼òµ¥µÄÀí½â¾ÍÊÇÁ½Ì¨¼ÆËã»úÏ໥ͨѶÊý¾Ý¶øÒÑ¡£¶ÔÓÚ³ÌÐòÔ±¶øÑÔ£¬È¥ÕÆÎÕÒ»ÖÖ±à³Ì½Ó¿Ú²¢Ê¹ÓÃÒ»ÖÖ±à³ÌÄ£ÐÍÏà¶Ô¾Í»áÏԵüòµ¥µÄ¶àÁË¡£Java SDKÌṩһЩÏà¶Ô¼òµ¥µÄApiÀ´Íê³ÉÕâЩ¹¤×÷£¬Socket¾ÍÊÇÆäÖÐÖ®Ò»¡£
¶ÔÓÚJava¶øÑÔ¡£ÕâЩApi´æÔÚÓëJava.netÕâ¸ö°üÀïÃæ¡£Òò´ËÖ»Òªµ¼ÈëÕâ¸ö°ü¾Í¿ÉÒÔ×¼±¸ÍøÂç±à³ÌÁË¡£ÍøÂç± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ