Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: String counter doesn't count the appropriate strings properly

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default String counter doesn't count the appropriate strings properly

    I have this source code that is supposed to count the repeated occurrences of certain strings in the text file, "string.txt".
    The contents of the file are listed below:
    AA-AB-AC-AG-AE-AL
    AL-AQ-AE-AN-AO-AM
    AM-AQ-AO-AA-AB-AC
    AD-AJ-AK-AI-AM-AO
    AN-AH-AC-AA-AP-AQ
    AP-AP-AN-AN-AL-AP
    AN-AD-AU-AE-AH-AQ
    AK-AQ-AE-AL-AE-AA
    AA-AJ-AB-AG-AE-AF
    AF-AE-AL-AI-AP-AM
    AU-AF-AJ-AV-AI-AM
    AP-AI-AQ-AK-AB-AC
    AU-AN-AL-AF-AO-AB
    AM-AA-AN-AM-AH-AO
    AP-AQ-AJ-AD-AN-AI
    AG-AU-AO-AD-AF-AI
    AQ-AM-AN-AB-AC-AK
    AN-AB-AI-AL-AE-AJ
    AB-AA-AP-AQ-AH-AD
    AC-AL-AG-AU-AJ-AM
    AL-AP-AB-AM-AA-AC
    AD-AE-AA-AC-AL-AB
    AO-AN-AQ-AK-AM-AQ
    AE-AI-AC-AH-AD-AJ
    AJ-AN-AM-AK-AL-AP
    But as I checked it against the actual contents, the output program isn't counting the occurrences properly. Instead of going through 10 lines as needed, it seems that it is skipping some lines.

    I have made two versions of the code where the placement of the break statement varies. But in both versions, the same problem persists
    (that is, the occurrences aren't counted properly). "AH" and "AI" are supposed to be counted since they are within the required first 10 lines - but for some reason, they aren't included...
    output for version01 source.jpg
    output for version02 source.jpg

    I couldn't place the break statement anywhere in the code without causing an error. Is there something I missed out?
    Below are two versions of the code by the way:

    Version 01 source code>
    import java.io.*;
    import java.util.*;
     
    public class stringcounter_ver01{
    	public static void main (String args [])throws IOException {
    		Scanner search = new Scanner (new File ("string.txt"));
    		Scanner record = new Scanner (new File ("output.txt"));
     
    		int counterAA=0;
    		int counterAB=0;
    		int counterAC=0;				
    		int counterAD=0;
    		int counterAE=0;
    		int counterAF=0;
    		int counterAG=0;
    		int counterAH=0;
    		int counterAI=0;
    		int counterAJ=0;
    		int counterAK=0;
    		int counterAL=0;
    		int counterAM=0;
    		int counterAN=0;
    		int counterAO=0;
    		int counterAP=0;
    		int counterAQ=0;
     
    		String counterrecordAA=" ";		
    		String counterrecordAB=" ";		
    		String counterrecordAC=" ";				
    		String counterrecordAD=" ";		
    		String counterrecordAE=" ";		
    		String counterrecordAF=" ";		
    		String counterrecordAG=" ";		
    		String counterrecordAH=" ";		
    		String counterrecordAI=" ";		
    		String counterrecordAJ=" ";		
    		String counterrecordAK=" ";		
    		String counterrecordAL=" ";		
    		String counterrecordAM=" ";		
    		String counterrecordAN=" ";		
    		String counterrecordAO=" ";		
    		String counterrecordAP=" ";		
    		String counterrecordAQ=" ";		
    		String spacer="--------------------------------------------------------------";
     
    		int maxLines=10;
     
    		while (search.hasNextLine() && maxLines>=0)
    		     { //while loop starting brace
    			  String scanline = search.nextLine();
    			  String charArray[]  = scanline.split("-");
    			  for (int counter=0; counter<=10; counter++)
    			     { // for loop starting brace
    			      if (charArray[counter].equals("AA"))
    			        {  //first main outer if loop starting brace
    				     counterAA++;
    				     counterrecordAA="AA has occurred " + counterAA + " times \t\n";
                                         break;
    			        }  //first main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AB"))
    			        {  //second main outer if loop starting brace
    				     counterAB++;
    				     counterrecordAB="AB has occurred " + counterAB + " times \t\n";
                                         break;
    			        }  //second main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AC"))
    			        {  //third main outer if loop starting brace
    				     counterAC++;
    				     counterrecordAC="AC has occurred " + counterAC + " times \t\n";
                                         break;
    			        }  //third main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AD"))
    			        {  //fourth main outer if loop starting brace
    				     counterAD++;
    				     counterrecordAD="AD has occurred " + counterAD + " times \t\n";
                                         break;
    			        }  //fourth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AE"))
    			        {  //fifth main outer if loop starting brace
    				     counterAE++;
    				     counterrecordAE="AE has occurred " + counterAE + " times \t\n";
                                         break;
    			        }  //fifth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AF"))
    			        {  //sixth main outer if loop starting brace
    				     counterAF++;
    				     counterrecordAF="AF has occurred " + counterAF + " times \t\n";
                                         break;
    			        }  //sixth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AG"))
    			        {  //seventh main outer if loop starting brace
    				     counterAG++;
    				     counterrecordAG="AG has occurred " + counterAG + " times \t\n";
                                         break;
    			        }  //seventh main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AH"))
    			        {  //eighth main outer if loop starting brace
    				     counterAH++;
    				     counterrecordAH="AH has occurred " + counterAH + " times \t\n";
                                         break;
    			        }  //eighth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AI"))
    			        {  //ninth main outer if loop starting brace
    				     counterAI++;
    				     counterrecordAI="AI has occurred " + counterAI + " times \t\n";
                                         break;
    			        }  //ninth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AJ"))
    			        {  //10th main outer if loop starting brace
    				     counterAJ++;
    				     counterrecordAJ="AJ has occurred " + counterAJ + " times \t\n";
                                         break;
    			        }  //10th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AK"))
    			        {  //11th main outer if loop starting brace
    				     counterAK++;
    				     counterrecordAK="AK has occurred " + counterAK + " times \t\n";
                                         break;
    			        }  //11th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AL"))
    			        {  //12th main outer if loop starting brace
    				     counterAL++;
    				     counterrecordAL="AL has occurred " + counterAL + " times \t\n";
                                         break;
    			        }  //12th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AM"))
    			        {  //13th main outer if loop starting brace
    				     counterAM++;
    				     counterrecordAM="AM has occurred " + counterAM + " times \t\n";
                                         break;
    			        }  //13th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AN"))
    			        {  //14th main outer if loop starting brace
    				     counterAN++;
    				     counterrecordAN="AN has occurred " + counterAN + " times \t\n";
                                         break;
    			        }  //14th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AO"))
    			        {  //15th main outer if loop starting brace
    				     counterAO++;
    				     counterrecordAO="AO has occurred " + counterAO + " times \t\n";
                                         break;
    			        }  //15th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AP"))
    			        {  //16th main outer if loop starting brace
    				     counterAP++;
    				     counterrecordAP="AP has occurred " + counterAP + " times \t\n";
                                         break;
    			        }  //16th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AQ"))
    			        {  //17th main outer if loop starting brace
    				     counterAQ++;
    				     counterrecordAQ="AQ has occurred " + counterAQ + " times \t\n";
                                         break;
    			        }  //17th main outer if loop ending brace
            	     } // for loop ending brace
    		     }//while loop ending brace
     
    		FileWriter recorder=new FileWriter("output.txt",true);
    		recorder.write(spacer+System.getProperty("line.separator"));	
     
    		recorder.write(counterrecordAA+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAB+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAC+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAD+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAE+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAF+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAG+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAH+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAI+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAJ+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAK+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAL+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAM+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAN+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAO+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAP+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAQ+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.close();				        		
    	}
    }

    Version 02 source code>
    import java.io.*;
    import java.util.*;
     
    public class stringcounter_ver02{
    	public static void main (String args [])throws IOException {
    		Scanner search = new Scanner (new File ("string.txt"));
    		Scanner record = new Scanner (new File ("output.txt"));
     
    		int counterAA=0;
    		int counterAB=0;
    		int counterAC=0;				
    		int counterAD=0;
    		int counterAE=0;
    		int counterAF=0;
    		int counterAG=0;
    		int counterAH=0;
    		int counterAI=0;
    		int counterAJ=0;
    		int counterAK=0;
    		int counterAL=0;
    		int counterAM=0;
    		int counterAN=0;
    		int counterAO=0;
    		int counterAP=0;
    		int counterAQ=0;
     
    		String counterrecordAA=" ";		
    		String counterrecordAB=" ";		
    		String counterrecordAC=" ";				
    		String counterrecordAD=" ";		
    		String counterrecordAE=" ";		
    		String counterrecordAF=" ";		
    		String counterrecordAG=" ";		
    		String counterrecordAH=" ";		
    		String counterrecordAI=" ";		
    		String counterrecordAJ=" ";		
    		String counterrecordAK=" ";		
    		String counterrecordAL=" ";		
    		String counterrecordAM=" ";		
    		String counterrecordAN=" ";		
    		String counterrecordAO=" ";		
    		String counterrecordAP=" ";		
    		String counterrecordAQ=" ";		
    		String spacer="--------------------------------------------------------------";
     
    		int maxLines=10;
     
    		while (search.hasNextLine() && maxLines>=0)
    		     { //while loop starting brace
    			  String scanline = search.nextLine();
    			  String charArray[]  = scanline.split("-");
    			  for (int counter=0; counter<=10; counter++)
    			     { // for loop starting brace
    			      if (charArray[counter].equals("AA"))
    			        {  //first main outer if loop starting brace
    				     counterAA++;
    				     counterrecordAA="AA has occurred " + counterAA + " times \t\n";
    			        }  //first main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AB"))
    			        {  //second main outer if loop starting brace
    				     counterAB++;
    				     counterrecordAB="AB has occurred " + counterAB + " times \t\n";
    			        }  //second main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AC"))
    			        {  //third main outer if loop starting brace
    				     counterAC++;
    				     counterrecordAC="AC has occurred " + counterAC + " times \t\n";
    			        }  //third main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AD"))
    			        {  //fourth main outer if loop starting brace
    				     counterAD++;
    				     counterrecordAD="AD has occurred " + counterAD + " times \t\n";
    			        }  //fourth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AE"))
    			        {  //fifth main outer if loop starting brace
    				     counterAE++;
    				     counterrecordAE="AE has occurred " + counterAE + " times \t\n";
    			        }  //fifth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AF"))
    			        {  //sixth main outer if loop starting brace
    				     counterAF++;
    				     counterrecordAF="AF has occurred " + counterAF + " times \t\n";
    			        }  //sixth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AG"))
    			        {  //seventh main outer if loop starting brace
    				     counterAG++;
    				     counterrecordAG="AG has occurred " + counterAG + " times \t\n";
    			        }  //seventh main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AH"))
    			        {  //eighth main outer if loop starting brace
    				     counterAH++;
    				     counterrecordAH="AH has occurred " + counterAH + " times \t\n";
    			        }  //eighth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AI"))
    			        {  //ninth main outer if loop starting brace
    				     counterAI++;
    				     counterrecordAI="AI has occurred " + counterAI + " times \t\n";
    			        }  //ninth main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AJ"))
    			        {  //10th main outer if loop starting brace
    				     counterAJ++;
    				     counterrecordAJ="AJ has occurred " + counterAJ + " times \t\n";
    			        }  //10th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AK"))
    			        {  //11th main outer if loop starting brace
    				     counterAK++;
    				     counterrecordAK="AK has occurred " + counterAK + " times \t\n";
    			        }  //11th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AL"))
    			        {  //12th main outer if loop starting brace
    				     counterAL++;
    				     counterrecordAL="AL has occurred " + counterAL + " times \t\n";
    			        }  //12th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AM"))
    			        {  //13th main outer if loop starting brace
    				     counterAM++;
    				     counterrecordAM="AM has occurred " + counterAM + " times \t\n";
    			        }  //13th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AN"))
    			        {  //14th main outer if loop starting brace
    				     counterAN++;
    				     counterrecordAN="AN has occurred " + counterAN + " times \t\n";
    			        }  //14th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AO"))
    			        {  //15th main outer if loop starting brace
    				     counterAO++;
    				     counterrecordAO="AO has occurred " + counterAO + " times \t\n";
    			        }  //15th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AP"))
    			        {  //16th main outer if loop starting brace
    				     counterAP++;
    				     counterrecordAP="AP has occurred " + counterAP + " times \t\n";
    			        }  //16th main outer if loop ending brace
     
    			 else if (charArray[counter].equals("AQ"))
    			        {  //17th main outer if loop starting brace
    				     counterAQ++;
    				     counterrecordAQ="AQ has occurred " + counterAQ + " times \t\n";
    			        }  //17th main outer if loop ending brace			        
                                  break;
            	             } // for loop ending brace
    		     }//while loop ending brace
     
    		FileWriter recorder=new FileWriter("output.txt",true);
    		recorder.write(spacer+System.getProperty("line.separator"));	
     
    		recorder.write(counterrecordAA+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAB+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAC+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAD+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAE+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAF+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAG+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAH+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAI+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAJ+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAK+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAL+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAM+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAN+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAO+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAP+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.write(counterrecordAQ+System.getProperty("line.separator"));
    		recorder.write(spacer+System.getProperty("line.separator"));
     
    		recorder.close();				        		
    	}
    }


  2. #2
    Member
    Join Date
    Apr 2012
    Posts
    161
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Default Re: String counter doesn't count the appropriate strings properly

    Well there is a bit of an issue with your for loop
    for (int counter=0; counter<=10; counter++)
    You are wanting to cycle through the strings you just split up, but you do not have 10 of them in the array. You should use charArray.length instead of 10.

    I would also recommend you look into using a hash map to keep track of the occurrences as it would be much simpler to implement.

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: String counter doesn't count the appropriate strings properly

    I pulled off the source code from a notepad copy. The counter was supposed to be a "5" and not "10".
    Unfortunately, though the counter value is set at 5, it still doesn't work. I remember using hashmap in an earlier version of that code.
    Using it wasn't easy for me as you might think.

    Any suggestions that I can do to stretch whatever limits using Scanner may have in the code above?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: String counter doesn't count the appropriate strings properly

    Also posted at: String counter doesn't count the appropriate strings properly

    Instead of going through 10 lines as needed, it seems that it is skipping some lines.
    To find out what lines it is skipping, add some println() statements to print out ALL of the lines that are read immediately after they are read. The print out will show you if any lines are skipped.

    Also add an else statement at the end of the long chain of if/else if statements that prints out a message when none of the above statements were true. Print out the value that was being tested.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    Feb 2014
    Posts
    180
    Thanks
    0
    Thanked 48 Times in 45 Posts

    Default Re: String counter doesn't count the appropriate strings properly

    Cross-posted at String counter doesn't count the appropriate strings properly. In the future please state up-front if your post is also posted in another forum, and provide the URL to your other post. This is so that anyone thinking of replying to your post can quickly check if it has already been answered elsewhere.

    The main reason for the problem you're experiencing is the incorrect use of the break statement. E.g., in version 01:
    for (int counter = 0; counter <= 10; counter++) { // for loop starting brace
        if (charArray[counter].equals("AA")) { // first main outer if loop starting brace
            counterAA++;
            counterrecordAA = "AA has occurred " + counterAA + " times \t\n";
            break;
        } // first main outer if loop ending brace
        ...
        else if (charArray[counter].equals("AQ")) { // 17th main outer if loop starting
                                                    // brace
            counterAQ++;
            counterrecordAQ = "AQ has occurred " + counterAQ + " times \t\n";
            break;
        } // 17th main outer if loop ending brace
    } // for loop ending brace

    The break statement breaks out of the for loop once any of the if conditions evaluates to true. In effect the for loop, unless there is a case not matched by any of the if statements, never iterates more than once.

    This similarly happens with version 02:
    for (int counter = 0; counter <= 10; counter++) { // for loop starting brace
        if (charArray[counter].equals("AA")) { // first main outer if loop starting brace
            counterAA++;
            counterrecordAA = "AA has occurred " + counterAA + " times \t\n";
        } // first main outer if loop ending brace
        ...
        else if (charArray[counter].equals("AQ")) { // 17th main outer if loop starting
                                                    // brace
            counterAQ++;
            counterrecordAQ = "AQ has occurred " + counterAQ + " times \t\n";
        } // 17th main outer if loop ending brace
        break;
    } // for loop ending brace

    In this case the break statement breaks out of the for loop regardless if any of the if conditions evaluates to true, and so the for loop will never iterate more than once.

    See Branching Statements (The Java™ Tutorials > Learning the Java Language > Language Basics) if you're unsure how the break statement works.

    As Norm suggested, add some println() statements so that you can see what's happening when you execute your code. E.g., for version 02 you can add println()s at the following 2 locations:
    while (search.hasNextLine() && maxLines >= 0) { // while loop starting brace
        String scanline = search.nextLine();
     
        System.out.println("scanline = " + scanline);
        String charArray[] = scanline.split("-");
     
        for (int counter = 0; counter <= 10; counter++) { // for loop starting brace
     
            System.out.println("charArray[" + counter + "] = " + charArray[counter]);
            ...

    Note that after you have rectified the problem with the break statement, you will encounter another problem with the use of counter in the for loop.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: String counter doesn't count the appropriate strings properly

    Also posted at: String counter doesn&#39;t count the appropriate strings properly - Java - Codecall
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Column count doesn't match value count at row 1
    By Tyluur in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 30th, 2012, 01:31 AM
  2. Code compiles fine but doesn't run Properly
    By nadirkhan in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 9th, 2011, 12:46 PM
  3. Validation based program that doesn't function properly
    By kratos75 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 28th, 2011, 06:34 AM
  4. Code doesn't execute properly
    By fride360 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 12th, 2011, 12:36 PM
  5. Constructor doesn't fill in array properly
    By Whyareall in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 6th, 2010, 04:24 AM

Tags for this Thread