资 源 简 介
finaloverridingillusion.ziplic class DoWhileDemo {
public static void main(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)
}
}
-finaloverridingillusion.ziplic class D. oWhileDemo (public static void main (String [] args) (String copyFromMe = "Copy this string un til you encounter the letter g. "StringBuffer c opyToMe = new StringBuffer () int i = 0 char c = cop yFromMe.charAt (i) do (copyToMe.append (c) c = copyFromMe.charAt (i)) while (c! = g) System.o ut.println (copyToMe