Java Format - Java DateFormat.hashCode()








Syntax

DateFormat.hashCode() has the following syntax.

public int hashCode()

Example

In the following code shows how to use DateFormat.hashCode() method.

import java.text.DateFormat;
import java.util.Date;
//  ww  w . java 2  s . c o m
public class Main {
  public static void main(String[] argv) throws Exception {
    DateFormat dateFormat = DateFormat.getDateTimeInstance();
    
    
    String s = dateFormat.format(new Date());
    System.out.println(dateFormat.hashCode());

  }
}

The code above generates the following result.