This is my program in which m reading from a filr with approx 40000 Strings in which m making a combination of all 40000 strings with other using a while loop but the loop is running only for first entry of the nested loop what is the problem with this code and can any body give me sugessions for such a huge loop??
package combinator; import java.io.*; import Reader.HandsFileReader; public class FinalCombination{ HandsFileReader hfr=new HandsFileReader(); BufferedReader b,s; String bs1,bs2, ss; final String separator =System.getProperty("line.separator"); public void finalRead(){ try{ FileWriter fr=new FileWriter("F:/java/Project/outputfiles/FinalCombination.txt"); b=hfr.readSingle(); s=hfr.readSamyukta(); while((bs1=b.readLine())!=null){ while((bs2=b.readLine())!=null){ String temp=(bs1+","+bs2); char []c=temp.toCharArray(); for(int i=0;i<c.length;i++){ fr.append(c[i]); } fr.append(separator); } while((ss=s.readLine())!=null){ String temp=(ss+","+ss); char []c=temp.toCharArray(); for(int i=0;i<c.length;i++){ fr.append(c[i]); } fr.append(separator); } fr.close(); } } catch(IOException e){ e.printStackTrace(); } System.out.println("Done"); } public static void main(String[] args) { FinalCombination fc=new FinalCombination(); fc.finalRead(); } }