diff --git a/.obsidian/workspace b/.obsidian/workspace index fd51039..70c9d1e 100644 --- a/.obsidian/workspace +++ b/.obsidian/workspace @@ -9,7 +9,7 @@ "state": { "type": "markdown", "state": { - "file": "00. Inbox/00. Inbox/A cheatsheet of modern C++ language and library features.md", + "file": "03. Programming/Kotlin/class.md", "mode": "source", "source": true } @@ -40,7 +40,7 @@ "state": { "type": "search", "state": { - "query": "精確", + "query": "kotlin", "matchingCase": false, "explainSearch": false, "collapseAll": false, @@ -69,7 +69,7 @@ "state": { "type": "backlink", "state": { - "file": "00. Inbox/00. Inbox/A cheatsheet of modern C++ language and library features.md", + "file": "03. Programming/Kotlin/class.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -86,7 +86,7 @@ "state": { "type": "outline", "state": { - "file": "00. Inbox/00. Inbox/A cheatsheet of modern C++ language and library features.md" + "file": "03. Programming/Kotlin/class.md" } } } @@ -116,15 +116,15 @@ }, "active": "828beb43bb437dd1", "lastOpenFiles": [ - "00. Inbox/00. Inbox/Modern C++ use in Chromium.md", - "00. Inbox/00. Inbox/C++20, How Hard Could It Be.md", - "00. Inbox/00. Inbox.md", "01. 個人/02. 專注Study/RxKotlin/20200207 - Study RxKotlin.md", - "00. Inbox/03. Mind Map.md", - "03. Programming/演算法.md", - "00. Inbox/01. TODO.md", - "00. Inbox/02. Kanban TODO - Logitech.md", - "00. Inbox/02. Kanban TODO - Me.md", - "02. 工作/01. Logitech/Tiny.md" + "01. 個人/01. Daily/2021/08/2021-08-16(週一).md", + "01. 個人/01. Daily/2021/08/2021-08-14(週六).md", + "01. 個人/01. Daily/2021/02/2021-02-22(Mon).md", + "01. 個人/01. Daily/2020/12/2020-12-19(Sat).md", + "01. 個人/01. Daily/2020/12/2020-12-11(Fri).md", + "01. 個人/01. Daily/2020/12/2020-12-09(Wed).md", + "01. 個人/01. Daily/2018/2018-10-12(週五).md", + "00. Inbox/00. Inbox/A cheatsheet of modern C++ language and library features.md", + "00. Inbox/00. Inbox/Modern C++ use in Chromium.md" ] } \ No newline at end of file diff --git a/03. Programming/Kotlin/class.md b/03. Programming/Kotlin/class.md new file mode 100644 index 0000000..cced2ff --- /dev/null +++ b/03. Programming/Kotlin/class.md @@ -0,0 +1,11 @@ +Kotlin中的class由class關鍵字開始,一個簡單的class如下: +class VerySimple { + +} + +如果需要constructor的話,則在class名稱之後加入所需的參數,如下: +class VerySimple(para1: Int, para2: String ) { + +} + +加在constructor中的參數會自動變成class的「成員變數」,如果在參數前面加上private,則會成「私有成員變數」,也就是無法被外部所存取。 \ No newline at end of file