<script type="text/javascript"> google_ad_client = "pub-8800625213955058"; /* 336x280, 创建于 07-11-21 */ google_ad_slot = "0989131976"; google_ad_width = 336; google_ad_height = 280; // </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> 本人也是一个学习java的初学者,一时心血来潮写2个简单的数组排序,第一个 从大到小,从小到大都可以实现排序,第二个则是用Arrays类中的sort方法 public class Array /*类名*/ { public static void main(String[] args) { int[] a=new int[]{32,11,44,70,4};/*初始化数组*/ for(int j=0;j
a[k 1])/*这里2个数组的比较*/ { int temp=0; temp=a[k]; a[k]=a[k 1]; a[k 1]=temp; } } } for(int i=0;i
a[k 1])改成if(a[k]