Java FloatBuffer.equals(Object ob)

Syntax

FloatBuffer.equals(Object ob) has the following syntax.

public boolean equals(Object ob)

Example

In the following code shows how to use FloatBuffer.equals(Object ob) method.


import java.nio.FloatBuffer;
/*from w w  w  .  jav  a2  s.  c o  m*/
public class Main {
  public static void main(String[] args) {
    FloatBuffer floatBuffer = FloatBuffer.allocate(10);
    
    floatBuffer.put(0,1.23F);
    
    floatBuffer.rewind();
    
    FloatBuffer floatBuffer1 = floatBuffer.compact();
    
    System.out.println(floatBuffer.equals(floatBuffer1));

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.nio »




Buffer
ByteBuffer
ByteOrder
CharBuffer
DoubleBuffer
FloatBuffer
IntBuffer
LongBuffer
MappedByteBuffer
ShortBuffer