File class equals(Object obj)method example
Tests this abstract pathname for equality with the given object.
File class equals(Object obj)method example. This example shows you how to use equals(Object obj) method.This method Tests this abstract pathname for equality with the given object.
Here is the code:-
/**
* @Program that Tests this abstract pathname for equality with the given object
* Equals.java
* Author:-RoseIndia Team
* Date:-30-May-2008
*/
import java.io.*;
public class Equals {
public static void main(String[] args) throws IOException{
File f=new File("/home/girish/Desktop/g.txt");
File f1=new File("/home/girish/Desktop/g.txt");
// Tests this abstract pathname for equality with the given object.
boolean b=f.equals(f1);
System.out.println("Equals: "+b);
}
} |
|