0

I am getting the two different path that are basically file path , injected through xml by spring ioc..

private String FilePath1; //it consists path c:\abc folder
private String FilePath2; //it consists of c:\abc\def

now I need to check that if they two are equal then they should go inside the condition otherwise not

please advise how to achieve this..

what I have tried is ..

if (FilePath1 =! FilePath2)
{

filemove(mcrpFilePath, zipfileName); //i want if two file paths are not wqula then it                                     // should go inside filemove
}

1 Answers1

1

Use equals() to compare Java Strings. The reason for this is because Strings are objects in Java. Therefore, the == operator tests to see if two objects point to the same instance! not whether they are equal to each other.

blackpanther
  • 10,998
  • 11
  • 48
  • 78