From b917195923f1b767d636bd312b28ed506d1ca985 Mon Sep 17 00:00:00 2001 From: zeekling Date: Wed, 5 May 2021 19:34:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=86=85=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=9A=84=E5=8F=98=E9=87=8F=E6=B2=A1=E6=9C=89=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=80=BC=EF=BC=8C=E5=BF=85=E9=A1=BB=E8=A6=81=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E3=80=82=20=E7=B1=BB=E4=B8=AD?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=9A=84=E5=8F=98=E9=87=8F=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E8=B5=8B=E4=BA=88=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=80=BC=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=88=9D=E5=A7=8B=E5=80=BC?= =?UTF-8?q?=E4=B8=BA0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zeekling/integer/IntegerTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/java/com/zeekling/integer/IntegerTest.java diff --git a/src/main/java/com/zeekling/integer/IntegerTest.java b/src/main/java/com/zeekling/integer/IntegerTest.java new file mode 100644 index 0000000..591c306 --- /dev/null +++ b/src/main/java/com/zeekling/integer/IntegerTest.java @@ -0,0 +1,18 @@ +package com.zeekling.integer; + + +public class IntegerTest { + + public static void main(String[] args) { + + int a = 10; + // 方法内定义的变量没有初始值,必须要进行初始化。 类中定义的变量可以不需要赋予初始值,默认初始值为0。 + int b = 0; + int c; + if (a > 50) { + b = 9; + } + c = b + a; + System.out.println("c=" + c); + } +}