【Java每日一题】201612015

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

时间: 2024-10-04 16:32:51

【Java每日一题】201612015的相关文章

【Java每日一题】20161103

package Nov2016; import java.util.List; public class Ques1103 { public void method01(String[] array){} public void method01(Integer[] array){} public void method02(List<String> list){} public void method02(List<Integer> list){} } 今日问题: 请问主程序能否

【Java每日一题】20170321

20170320问题解析请点击今日问题下方的"[Java每日一题]20170321"查看(问题解析在公众号首发,公众号ID:weknow619) package Mar2017; public class Ques0321 { public static void main(String[] args) { Ques0321 test = new Ques0321(); test.method(null); } public void method(Object o) { System

【Java每日一题】20170109

20170106问题解析请点击今日问题下方的"[Java每日一题]20170109"查看(问题解析在公众号首发,公众号ID:weknow619) package Jan2017; import java.util.ArrayList; import java.util.List; public class Ques0109<T> { private T t = new T(); private T[] array = new T[3]; private List<T&

【Java每日一题】20161212

package Dec2016;      public class Ques1212 {      public static void main(String[] args){          System.out.println(10.00-9.60);      }   } 今日问题: 请问主程序中输出结果是什么?(点击以下"[Java每日一题]20161212"查看20161209问题解析) 题目原发布于公众号.简书:[Java每日一题]20161212,[Java每日一题

【Java每日一题】20161201

20161130问题解析请点击今日问题下方的"[Java每日一题]20161201"查看 package Dec2016; public class Ques1201 { public static void main(String[] args) { new Ques1201().sum(1, 2); } public void sum(int num1, int num2){ int temp = num1 + num2; System.out.println("没使用变

【Java每日一题】20161130

20161129问题解析请点击今日问题下方的"[Java每日一题]20161130"查看 package Nov2016; public class Ques1130 { public static void main(String[] args) { int i = 1; Ques1130.test(i); Ques1130.test(Integer.valueOf(i)); } public static void test(long n){ System.out.println(

【Java每日一题】20170217

20170216问题解析请点击今日问题下方的"[Java每日一题]20170217"查看(问题解析在公众号首发,公众号ID:weknow619) package Feb2017; public class Ques0217 { public static void main(String[] args) { char[] c = new char[10]; System.out.println(c[5]); } } 今日问题: 请问主程序输出结果是什么?(点击以下"[Java

【Java每日一题】20170116

20170113问题解析请点击今日问题下方的"[Java每日一题]20170116"查看(问题解析在公众号首发,公众号ID:weknow619) package Jan2017; public class Ques0116 { public static void main(String[] args) { System.out.println(new BigDog("大黑狗", "黑色")); } } class Dog{ String nam

【Java每日一题】20170105

20170104问题解析请点击今日问题下方的"[Java每日一题]20170105"查看(问题解析在公众号首发,公众号ID:weknow619) package Jan2017; import java.util.ArrayList; import java.util.List; public class Ques0105 { public static void main(String[] args) { List<String> list = new ArrayList