2015年3月10日 星期二

[Basic Code] Array Create , Sort, add new elements to an ArrayList?


Object array
  int pro_index=20000;

  Progress pro[] = null;
  pro=new Progress[pro_index];

  for(int i=0; i < pro_index ;i++)
  {  
   pro[i]=new Progress();
  }

other type array:
http://alvinalexander.com/java/java-string-array-reference-java-5-for-loop-syntax

===============================================
final static int MAX_CAM_NUM=8;
private int[] camLocalPort=new int[MAX_CAM_NUM];
private int[] camRTSPPort=new int[MAX_CAM_NUM];

or

private int camLocalPort[]=new int[MAX_CAM_NUM];
private int camRTSPPort[]=new int[MAX_CAM_NUM];

====================================
Arrays.sort(fileListArr, Collections.reverseOrder());  //resort

============================================
How to add new elements to an array?
reference:
http://stackoverflow.com/questions/2843366/how-to-add-new-elements-to-an-array



沒有留言:

張貼留言