代码如下:

package com.java.day09;
// 字符串倒序输出
public class StringReversed {
    public static void main(String[] args) {
        String str1 = "helloworld";
        char[] chars = str1.toCharArray();
        for (int i = chars.length - 1; i >= 0; i--) {
            System.out.println(chars[i]);
        }
    }
}