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±êʶ·û£»
//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´úÂë
import java.util.Timer;
import java.util.TimerTask;
import java.util.Timer;
import java.util.TimerTask;
Java´úÂë
public class Test {
public static void main(String[] args) { ......
1 ËùÓÐµÄ .java|.jsp|.html|.xml Ô´Îļþ¾ùʹÓÃutf-8±àÂë¸ñʽ±£´æµ½ÏµÍ³´ÅÅÌ¡£
È磺ÔÚEclipseÖбà¼Îļþ£¬Ñ¡ÖÐÎļþ´ò¿ªÓÒ¼ü²Ëµ¥Ñ¡ÔñÊôÐÔ£¬½«Îı¾Îļþ±àÂëÉèÖÃΪÆäËû²¢Ñ¡ÔñUTF-8£»Ò²¿ÉÒÔÔÚ
Eclipse——Ê×Ñ¡Ïî——³£¹æ——ÄÚÈÝÀàÐÍÖÐÉèÖø÷ÖÖÎļþµÄȱʡ±àÂ룬ÕâÑùÒÔºóËùÓеÄÎı¾Îļþ¶¼Ê¹ÓÃÍ³Ò ......
ÀàÓëÀàÖ®¼ä´æÔÚÒÔϹØÏµ£º
1¡¢ ·º»¯(Generalization)
ºÜ¼òµ¥£¬¾ÍÊÇÎÒÃdz£ËµµÄ¼Ì³Ð¡£ÊÇ˵×ÓÀà»ñµÃ¸¸ÀàµÄ¹¦ÄܵÄͬʱ£¬»¹¿ÉÒÔÀ©Õ¹×Ô¼ºµÄ¹¦ÄÜ¡£
Èçͼ:
Java´úÂëÖбíÏÖΪ£ºextends ºÍ implements
2¡¢ ÒÀÀµ(Dependency)
Á½¸öÏà¶Ô¶ÀÁ¢µÄßËßË(AºÍB)£¬µ±A¸ºÔð¹¹ÔìBʱ£¬AÓëBÐγÉÒÀÀµ¹ØÏµ£¬¼´AʹÓÃB¡£
Èçͼ£º
Java´úÂëÖеıíÏÖ ......
package com.test.util;
import java.sql.*;
public class ConnectDB {
private Connection conn=null;
private PreparedStatement pt=null;
private ResultSet rs=null;
private String uname="sa";
private String upwd="sa";
private String url="jdbc:microsoft:sqlserv ......