提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
按长度重复星号并返回字符数组
//package com.nowjava; public class Main {// from 时 代 Java - nowjava.com public static void main(String[] argv) { int len = 42; System.out.println(java.util.Arrays.toString(repeatAsterisk(len))); } private static final char SEPARATOR_CHAR_ASTERISK = '*'; private static char[] repeatAsterisk(int len) { char[] chars = new char[len]; for (