public class Sample3_1b { public static void main(String[] args) { int x, y; // 宣言 x = 5; // 代入 y = x*x + 3*x + 2; System.out.println(" x = " + x + " のときは\n x^2 + 3x + 2 = " + y + " だよ!"); } }