Java IO Tutorial - Java Charset.equals(Object ob)


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

public final boolean equals(Object ob)


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

import java.nio.charset.Charset;
//from w  w w  .  ja va 2s. c om
public class Main {

  public static void main(String[] args) {
    Charset csets = Charset.forName("UTF-8");
    Charset csets1 = Charset.forName("UTF-8");


The code above generates the following result.