Infolinks In Text Ads

Jul 1, 2010

CharSequence java - What is CharSequence in java code example

public class Test {
        public static void main(String[] args) {       
           
             StringBuffer stringBuffer = new StringBuffer ("Hello World");
            
              CharSequence charSequence = stringBuffer;

              // print charSequence
              System.out.println(charSequence);

              // Append first in StringBuffer
              stringBuffer.append(" First Append");
              System.out.println(charSequence);

              // Append sceond in StringBuffer
              stringBuffer = stringBuffer.append(" Second Append");
              System.out.println(charSequence);
             
              //Append third in StringBuffer
              stringBuffer.setLength(0);
              stringBuffer = stringBuffer.append(" Third Append");
              System.out.println(charSequence);
        }
}

No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...