Append character at first position in StringBuilder java by class TestJava { public static void main(String[] args) { StringBuilder sb = new StringBuilder(); for(int i=0;i<10;i++){ sb.insert(0, Integer.toString(i)); } System.out.println("Result: " +sb.toString()); } } Output: Result: 9876543210