setCharAt « StringBuffer « Java Data Type Q&A





1. StringBuffer's setCharAt - near help    coderanch.com

I am having a problem with the following code that prints out permutations of a given string... class Permutations { public static void main(String[] args) { StringBuffer str = new StringBuffer("abc "); Permute(str); } private static void Permute(StringBuffer str) { int length, i; length = str.length(); int[] used = new int[length]; StringBuffer out = new StringBuffer(length); for(i=0;i