how to parse a String in java?
===

This is my code:

       		
    		String input = in.next();
    		String output = "";
    		
    		char c = 0;
    		
    		int count = 0;
    		int countInput = input.length();
    		
    		for(int i = 0; i < countInput; i++)
    		{
    			if (i == 0)
    			{
    				c = input.charAt(i);
    				count++;
    				
    			}
    			else
    			{	
    				if(c == input.charAt(i))
    			{
    				count++;
    				
    			}
    			else
    			{
    				output = output + count + "" + c;
    				count = 1;
    				c = input.charAt(i);
    				out.println(output);
    				
    			}
    			}
    		}
    	
    			
    		
    	output = output + count + "" + c;
    	out.println(output);
    	}
    }
    	
this program is suppose to work like this:

input:

java Testing AAAAAnnnfffkk


output:

5A3n3f2k

i need to fix this somehow:

    String input = in.next();

i think args has to be used somewhere, im not sure where tho

