import java.util.*; 
import java.io.*; 
public class DiGuiTest2 { 
public static void main(String[] args) throws Exception{ 
String[] array = new String[]{"1","2"};  //,"3","4"}; 
listAll(Arrays.asList(array),""); 

public static void listAll(List candidate, String prefix){ 
System.out.println(prefix); 
for(int i=0; i<candidate.size(); i++ ){ 
List temp = new LinkedList(candidate); listAll(temp,prefix+temp.remove(i)); 
System.out.println("--"+i);


解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【hehaibo0511】截止到2008-07-07 22:12:44的历史汇总数据(不包括此帖):
    发帖的总数量:0                        发帖的总分数:0                        
    结贴的总数量:0                        结贴的总分数:0                        
    无满意结贴数:0                        无满意结贴分:0                        
    未结的帖子数:0                        未结的总分数:0                        
    结贴的百分比:---------------------结分的百分比:---------------------
    无满意结贴率:---------------------无满意结分率:---------------------
    如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
      

  2.   

    String[] array = new String[]{"1","2"};  //,"3","4"}; ???是 String[] array = new String[]{"1","2","3","4"}; 么?