What is meant by this line?
sb.append(new StringBuffer(tx.nextToken()).reverse() +" ")
can anyone explain about it in detail?
What is meant by this line?
sb.append(new StringBuffer(tx.nextToken()).reverse() +" ")
can anyone explain about it in detail?
new StringBuffer(tx.nextToken()).reverse()
constructs a new StringBuffer, initialized by tx.nextToken()
and then reverses the content of the buffer.
Therefore sb.append(new StringBuffer(tx.nextToken()).reverse() +" ")
appends the reversed value of tx.nextToken()
in addition to a space to sb
.