FileDocCategorySizeDatePackage
DoWhileDemo.javaAPI DocExample428Tue Dec 12 18:58:12 GMT 2000None

DoWhileDemo

public class DoWhileDemo extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)


        String copyFromMe = "Copy this string until you encounter the letter 'g'.";
        StringBuffer copyToMe = new StringBuffer();

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

        do {
            copyToMe.append(c);
            c = copyFromMe.charAt(++i);
        } while (c != 'g");
        System.out.println(copyToMe);