I can print out the result without issues, and it seems working perfectly, I don't understand the mechanism behind this failure.
package zh.codegym.task.task08.task0801;
/*
包含植物的 HashSet
*/
import java.util.HashSet;
import java.util.Set;
public class Solution {
public static void main(String[] args) throws Exception {
Set<String> set = new HashSet<String>();
set.add("西瓜");
set.add("香蕉");
set.add("樱桃");
set.add("梨");
set.add("哈密瓜");
set.add("黑莓");
set.add("人参");
set.add("草莓");
set.add("鸢尾花");
set.add("土豆");
for (String a : set) {
System.out.println(a);
}
}
}