Java如何将字符串放进字符串数组中(亲测)

  1. String str1 = "aaa";

  2. String str2 = "bbb";

  3. String str3 = "ccc";

  4. List list = new ArrayList();

  5. list.add(str1);

  6. list.add(str2);

  7. list.add(str3);

  8. String[] arr = list.toArray(new String[0]);

  9. System.out.println(Arrays.toString(arr));

你可能感兴趣的:(springboot,java,java)