Efficient BlackBerry J2ME coding schemes? Can anyone clarify this?

I found sample folliwing code in BlackBerry Java Development, Best Practices . Can someone explain what the exact same code means? What is this in the example code for the expression?

Avoid StringBuffer.append (StringBuffer)

To add a String buffer to another, a BlackBerryยฎ Java application must use net.rim.device.api.util.StringUtilities.append( StringBuffer dst, StringBuffer src[, int offset, int length ] ).

Code example

public synchronized StringBuffer append(Object obj) {
    if (obj instanceof StringBuffer) {
        StringBuffer sb = (StringBuffer)obj;
        net.rim.device.api.util.StringUtilities.append( this, sb, 0, sb )
        return this;
    }
    return append(String.valueOf(obj));
}
+3
source share
2 answers

, StringBuffer . Java , StringBuffer. , StringBuffer, , StringBuffer.append(), net.rim.device.api.util.StringUtilities. , , append().

0

StringBuffer append(), StringBuffer. , , , StringBuffer.append(String str) .toString() StringBuffer. , , , StringBuffer. , , StringBuffer.

. , StringBuffer . , StringUtilities.append(StringBuffer, StringBuffer), , .

, , , , .

0

Source: https://habr.com/ru/post/1713628/


All Articles