String having unique characters



public class IsStringHavingUniqueChar {

	public static void main(String[] args) {
		System.out.println("isStringHavingUniqueCharacters: "+isStringHavingUniqueCharacters("Raaaahul"));
	}
	
	private static boolean isStringHavingUniqueCharacters(String str){
		
		boolean[] asciiArray = new boolean[256];
		for (int i = 0; i < str.length(); i++) {
			int charAscii = str.charAt(i);
			if(asciiArray[charAscii])
				return false;
			asciiArray[charAscii] = true;
		}
		
		return true;
	}
	
}