Convertir ‘varargs’ en un tableau

Author:


Download

 
public class VarArgsAuTableau {
 
  public static void affichageArgs(String... messages) {
	    String[] tableauVarArgs = messages; //convertir le varargs en tableaux
	    for (int i = 0; i < messages.length; i++) {
	      System.out.print(tableauVarArgs[i]);
	    }
  }
  public static void VarArgsAuTableau(String[] args) {
    affichageArgs("B", "o", "n", "j", "o", "u ", "r");
  }
 
}