-3

What is meant by this line?

sb.append(new StringBuffer(tx.nextToken()).reverse() +" ")

can anyone explain about it in detail?

serenesat
  • 4,611
  • 10
  • 37
  • 53

1 Answers1

0

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.

Eran
  • 387,369
  • 54
  • 702
  • 768