In this tutorial you will see how to compare buffer to another object. The compareTo method of CharBuffer class allow to compare buffer with another. This method returns 0, 1 or -1 which means it is equal, less and greater than the comparing buffer.
import java.nio.CharBuffer;
|
| 0 -1 1 |