From 40c1ce92296d9f8ca2176f2cda204d23058c0726 Mon Sep 17 00:00:00 2001 From: 7Wate Date: Wed, 27 Apr 2022 12:25:02 +0800 Subject: [PATCH] =?UTF-8?q?Java=EF=BC=9A=E5=9F=BA=E6=9C=AC=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=EF=BC=88=E5=85=B3=E9=94=AE=E5=AD=97=E3=80=81=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/开发/Java/基本语法.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/开发/Java/基本语法.md b/docs/开发/Java/基本语法.md index 1da34918..b76de979 100644 --- a/docs/开发/Java/基本语法.md +++ b/docs/开发/Java/基本语法.md @@ -82,5 +82,37 @@ int c = a++; variable x = (expression) ? value if true : value if false ``` +## 关键字 +| 类别 | | | | | | | | +| -------------------- | -------- | ---------- | -------- | ------------ | ---------- | --------- | ------ | +| 访问控制 | private | protected | public | | | | | +| 类,方法和变量修饰符 | abstract | class | extends | final | implements | interface | native | +| | new | static | strictfp | synchronized | transient | volatile | | +| 程序控制 | break | continue | return | do | while | if | else | +| | for | instanceof | switch | case | default | | | +| 错误处理 | try | catch | throw | throws | finally | | | +| 包相关 | import | package | | | | | | +| 基本类型 | boolean | byte | char | double | float | int | long | +| | short | null | true | false | | | | +| 变量引用 | super | this | void | | | | | +| 保留字 | goto | const | | | | | | + +## 注释 + +```java +public class HelloWorld { + /* + * 这是第一个Java程序 + * 它将打印Hello World + * 这是一个多行注释的示例 + * + */ + public static void main(String[] args){ + // 这是单行注释的示例 + /* 这个也是单行注释的示例 */ + System.out.println("Hello World"); + } +} +```