package Dec2016; import java.util.HashSet; public class Ques1205 { public static void main(String[] args){ StringBuffer sb1 = new StringBuffer("123"); StringBuffer sb2 = new StringBuffer("123"); StringBuffer sb3 = new StringBuffer("123"); StringBuffer sb4 = new StringBuffer("123"); HashSet<StringBuffer> set = new HashSet<StringBuffer>(); set.add(sb1); set.add(sb2); set.add(sb3); set.add(sb4); System.out.println(set.size()); } }
今日問題:
請問主程序輸出結果是什麼?(點擊以下“【Java每日一題】20161205”查看20161202問題解析)
題目原發布於公眾號、簡書:【Java每日一題】20161205,【Java每日一題】20161205