Java IO Tutorial - Java File.hashCode()








Syntax

File.hashCode() has the following syntax.

public int hashCode()

Example

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

// w ww .j a va2  s.  c om


import java.io.File;

public class Main {
  public static void main(String[] args) throws Exception {

    // create new files
    File f = new File("c:/");


    System.out.print(f.hashCode());

  }
}

The code above generates the following result.