Java instantiate Krótki obiekt w Javie
Zastanawiałem się, dlaczego możemy to zrobić:
Long l = 2L;
Float f = 2f;
Double d = 2d;
lub nawet
Double d = new Double(2);
i nie
Short s = 2s; //or whatever letter it could be
ani
Short s = new Short(2); //I know in this case 2 is an int but couldn't it be casted internally or something?
Dlaczego musimy wziąć konstruktorów za pomocą ciągu lub krótkiego.