public class javaTest { public static void test(String ...strings){ for(String str: strings){ System.out.print(str + " "); } System.out.println(); } public static void main(String[] args){ test("a", "b", "c", "ddd"); test("a"); test("aaa", "aaadfd"); } } 输出结果 a b c ddd a aaa aaadfd 相关文章: 2022-12-23 2022-01-09 2021-06-24 2021-12-03 2022-12-23 2022-12-23 2021-08-20 2021-07-20