|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
waba.lang.Object | +--waba.lang.StringBuffer
StringBuffer is an array of strings.
This class is used in code such as:
String s = "Number: " + i + " Name: " + s;to concatenate multiple strings together. In the code shown, the compiler generates references to the StringBuffer class to append the objects together.
As with all classes in the waba.lang package, you can't reference the StringBuffer class using the full specifier of waba.lang.StringBuffer. The waba.lang package is implicitly imported. Instead, you should simply access the StringBuffer like this:
StringBuffer sb = new StringBuffer(s);
Constructor Summary | |
StringBuffer()
Constructs an empty string buffer. |
|
StringBuffer(String s)
Constructs a string buffer containing the given string. |
Method Summary | |
StringBuffer |
append(boolean b)
Constructs a string buffer containing the string representation of the given boolean value. |
StringBuffer |
append(char c)
Constructs a string buffer containing the string representation of the given char value. |
StringBuffer |
append(char[] c)
Appends the given character array as a string to the string buffer. |
StringBuffer |
append(float f)
Constructs a string buffer containing the string representation of the given float value. |
StringBuffer |
append(int i)
Constructs a string buffer containing the string representation of the given int value. |
StringBuffer |
append(Object obj)
Appends the string representation of the given object to the string buffer. |
StringBuffer |
append(String s)
Appends the given string to the string buffer. |
void |
setLength(int zero)
Empties the StringBuffer and clears out its contents so it may be reused. |
String |
toString()
Converts the string buffer to its string representation. |
Constructor Detail |
public StringBuffer()
public StringBuffer(String s)
Method Detail |
public StringBuffer append(boolean b)
Convert
public StringBuffer append(char c)
Convert
public StringBuffer append(int i)
Convert
public StringBuffer append(float f)
Convert
public StringBuffer append(char[] c)
public StringBuffer append(String s)
public StringBuffer append(Object obj)
public void setLength(int zero)
public String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |