<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Write a java program to print the frequencies of all characters in a string.
string = "mississippi"<|im_end|>
<|im_start|>assistant
public class Frequency { 
	static void characterFrequency(String str) 
	{ 
		// size of the string 'str' 
		int n = str.length(); 

		// 'freq[]' implemented as hash table 
		int freq[] = new int[256]; 

		// accumulate freqeuncy of each character 
		// in 'str' 
		for (int i = 0; i < n; i++) 
			freq[str.charAt(i)]++; 

		// traverse 'str' from left to right 
		for (int i = 0; i < n; i++) { 

			// if frequency of character str.charAt(i) 
			// is not equal to 0 
			if (freq[str.charAt(i)] != 0) { 

				// print the character along with its 
				// frequency 
				System.out.print(str.charAt(i)); 
				System.out.print(freq[str.charAt(i)] + " "); 

				// update frequency of str.charAt(i) to 
				// 0 so that the same character is not printed 
				// again 
				freq[str.charAt(i)] = 0; 
			} 
		} 
	} 

	// Driver code 
	public static void main(String args[]) 
	{ 
		String str = "mississippi"; 
		characterFrequency(str); 
	} 
}<|im_end|>
