Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用字符串和未知数量的参数创建方法?
谢谢。
public void printXXX(char c, int... ints) { for (int i : ints) { for (j = 0; j < i; j++) { System.out.print(c); } System.out.println(); } }