Last active
August 29, 2015 14:04
-
-
Save kenorb/7b58291904029357216f to your computer and use it in GitHub Desktop.
StringBuffer class Demo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * StringBufferDemo.java | |
| * | |
| * StringBuffer class Demo. | |
| * | |
| * A thread-safe, mutable sequence of characters. | |
| * A string buffer is like a String, but can be modified. | |
| * At any point in time it contains some particular sequence of characters, | |
| * but the length and content of the sequence can be changed through certain method calls. | |
| * | |
| * Usage: | |
| * javac StringBufferDemo.java && java StringBufferDemo | |
| */ | |
| class StringBufferDemo { | |
| public static void main(String args[]) { | |
| StringBuffer sb = new StringBuffer("hello"); | |
| sb.append("java"); | |
| System.out.println(sb); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment