Witshaper is the Professional (Computing Skills, English Learning and Soft Skills) Skill Development Training Center. We provide Professional IT Courses and Soft Skill Training in Dehradun to Students, Employees and organization. Who wish to pursue a career in IT Technology. Witshaper is led by a motivated team of IT experts and Soft Skill Professionals. We provide high quality trainings. Our Emphasis is on giving the practical knowledge to the students, so that they will get to know in depth and never forget what they opt, we provide to the students real learning environment. Witshaper prepares students and professionals to be the part of this growing industry. Be a part of Witshaper and get your dreams successful

Tuesday, 12 May 2015

java program to search Exact data of different files

package newpackage3;
/**
 *
 * @author rajani
 */
import java.io.File;
import org.apache.commons.io.FileUtils;
public class compareFileContent
{
        public static void main(String[] args) throws Exception
        {
                /* Get the files to be compared first */
                File file1 = new File("temp.txt");
                File file2 = new File("amazon.txt");
                File file3 = new File("amazoncomp.txt");
                boolean compareResult = FileUtils.contentEquals(file1, file2);
                boolean compp=FileUtils.contentEquals(file1,file3);
                if(compareResult==true)
                {
                    System.out.println("amazon file");
                }
                if(compp==true)
                {
                   System.out.println("amazoncomp file");
                }
                  
               
        }
}

No comments:

Post a Comment