hi,
here is my code having return method that working correctly when i print it from inside of the method, but if i call from main method its shows only one output instead all results..
public class SearchCompare{
....
public String process(){
String showResult=null;
...
..
for (String found: names.keySet()) {
File file = names.get(found);
double compare = SearchCompare.LCS(found, searchName);
showResult="Found Names: "+found+ "Similarity: " +compare+"Path: "+file.getName();
//showResult=found+compare+file.getName();
System.out.println(showResult); //shows all result here...
}
return showResult;
}
public static void main (String[] args){
SearchCompare sc=new SearchCompare();
String st= sc.process();
System.out.print(st);//showing only one(the last one) found names
}
}
anybody pls tell me where need to change ??