2014-11-20から1日間の記事一覧
public class Main{ public static void main(String[] args) { byte x = 3; byte y = 2 * x++; System.out.println(y); }} 上記コードはコンパイルエラーになる。 byte型のyに代入するべき右辺の演算結果がint型になるので、キャストしないと代入できない。…
public class Main{ public static void main(String[] args) { byte x = 3; byte y = 2 * x++; System.out.println(y); }} 上記コードはコンパイルエラーになる。 byte型のyに代入するべき右辺の演算結果がint型になるので、キャストしないと代入できない。…