«type-promotion» etiketlenmiş sorular

3
"Kısa otuz = 3 * 10" neden yasal bir görevdir?
Eğer shortotomatik terfi edilir intaritmetik işlemlerinde, sonra neden olduğunu: short thirty = 10 * 3; shortDeğişkene yasal bir atama thirtymı? Sırayla, bu: short ten = 10; short three = 3; short thirty = ten * three; // DOES NOT COMPILE AS EXPECTED bunun kadar iyi: int ten = 10; int …

3
Parametrelerde Java tipi tanıtımı
Bu pasajı tökezledim: public class ParamTest { public static void printSum(int a, double b) { System.out.println("In intDBL " + (a + b)); } public static void printSum(long a, long b) { System.out.println("In long " + (a + b)); } public static void printSum(double a, long b) { System.out.println("In doubleLONG " …
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.