我想知道为什么我们可以这样做:
Long l = 2L;
Float f = 2f;
Double d = 2d;
甚至
Double d = new Double(2);
并不是
Short s = 2s; //or whatever letter it could be
也不
Short s = new Short(2); //I know in this case 2 is an int but couldn't it be casted internally or something?
为什么我们需要使用 String 或 short 构造函数。