«type-promotion» 태그된 질문

3
왜“short thirty = 3 * 10”이 법적 임무입니까?
경우 short자동으로 승격되어 int산술 연산에서, 왜이다 : short thirty = 10 * 3; short변수에 대한 법적 할당 thirty? 차례로 이것은 : short ten = 10; short three = 3; short thirty = ten * three; // DOES NOT COMPILE AS EXPECTED 뿐만 아니라 : int ten = 10; int three …

3
매개 변수에서 Java 유형 승격
나는이 발췌 문장을 우연히 발견했다. 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 …
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.