la boucle Do while””

Author:


{filelink=4628}


public class DoWhileDemo {
  public static void main(String[] args) {

    String meCopier = "Copier ce text jusqu'à ce que vous trouvez la lettre 'v'.";
    StringBuffer copierDansMoi = new StringBuffer();

    int i = 0;
    char c = meCopier.charAt(i);

    do {
      copierDansMoi.append(c);
      c = meCopier.charAt(++i);
    } while (c != 'v');
    System.out.println(copierDansMoi);
  }
}

A Voir sur le même Sujet:

  • while
  • boucle while jpasswordfield
  • boucles while ( c++ )
  • java tableaux dynamiques moyenne des notes

Leave a Reply

Your email address will not be published. Required fields are marked *