Kailash Vaviya
關於 Kailash Vaviya
Kailash Vaviya is a freelance writer who started writing in 2019 and has never stopped since then as he fell in love with it. He has a soft corner for technology and likes to read, learn, and write about it. His content is focused on providing information to help build a brand presence and gain engagement.
howto · 2026-09-17
在 Kotlin 中使用 Sleep 暫停執行緒執行
了解如何使用 Thread.sleep 或 TimeUnit 暫停 Kotlin/JVM 執行緒,以及何時改用 delay 或 ScheduledExecutorService。
howto · 2024-02-15
等效於 KClass 的 getClass()函式
Kotlin 允許通過 .javaClass() 解析變數類。在本文中,我們將瞭解如何以類似的方法檢索 KClass 引用。
howto · 2024-02-15
將 Kotlin 原始檔轉換為 Java 檔案
本文介紹如何將 Kotlin 原始檔轉換為 Java。
howto · 2024-02-15
在 Kotlin 中使用 Lazy 和 Lateinit 初始化屬性
Kotlin 允許使用 lazy 和 lateinit 關鍵字進行屬性初始化。本文闡明瞭它們的含義以及如何在 Kotlin 中使用它們。
howto · 2024-02-15
Swift 的 if Let 語句在 Kotlin 中的等效
Kotlin 的 let 和 run 相當於 Swift 的 if let 語句。我們將瞭解 Kotlin 如何讓和執行工作並通過一些示例。
howto · 2024-02-15
Kotlin 中的 suspend 函式
Kotlin Coroutine 是基於 suspend 函式的。本文介紹什麼是 Kotlin 協程中的掛起函式以及如何實現。
howto · 2024-02-15
Kotlin 中的 Getter 和 Setter
Kotlin 中的屬性是通過 getter 和 setter 訪問的。本文介紹了 Kotlin set() 的概念以及我們如何使用它來訪問 Kotlin 程式碼中的屬性。
howto · 2024-02-15
Kotlin 中 open 關鍵字和 public 關鍵字的區別
本文將介紹 Kotlin open 和 public 關鍵字的使用。我們還將通過合適的示例詳細瞭解 open 關鍵字。
howto · 2024-02-15
關於 Kotlin 泛型的一切
今天,我們將瞭解 Kotlin 泛型,它們的用途,以及如何將特定型別傳遞給泛型方法。
howto · 2024-02-15
在 Kotlin 中獲取 forEach 迴圈的當前索引
知道迴圈的當前索引允許我們對集合的特定項執行各種操作。本文教你如何在 Kotlin 中獲取 forEach 迴圈的當前索引。
howto · 2024-02-15
Kotlin 中作用域函式的使用
本文介紹瞭如何在 Kotlin 中使用作用域函式。本文還演示了其他範圍函式的使用,包括 run、let、apply 和 with。
howto · 2024-02-15
Kotlin 中二級建構函式的使用
本文介紹了 Kotlin 中二級建構函式的概念以及如何使用它來初始化物件。
howto · 2024-02-15
在 Kotlin 中實現空值檢查
我們可以使用不同的方式在 Kotlin 中實現空值檢查。本文介紹瞭如何在 Kotlin 中進行空檢查。我們還將介紹一些在 Kotlin 中處理 null 的方法。
howto · 2024-02-15
在 Kotlin 中處理異常
本文介紹了 Kotlin throws 關鍵字以及我們如何使用它來處理 Kotlin 中的異常。
howto · 2024-02-15
在 Kotlin 中建立和使用靜態變數
Kotlin 允許建立靜態變數,但方式略有不同。本文介紹如何建立 Kotlin 靜態變數並使用它們。
howto · 2024-02-15
在 Kotlin 中使用 Elvis 運算子
我們將瞭解 Kotlin 中的 Elvis 運算子及其工作原理。我們還將通過一些示例來了解 Elvis 運算子的使用。
howto · 2024-02-15
Kotlin 中 Java 靜態函式的等價物
Java 具有有助於記憶體管理的靜態方法。但是 Kotlin 沒有任何 static 關鍵字,那麼 Kotlin 中的 Java 靜態方法有什麼等價物呢?
howto · 2024-02-15
Kotlin 中 val 和 var 的區別
本文介紹了使用 val 和 var 宣告變數的概念。它也消除了兩者之間的差異。
howto · 2023-10-12
重寫 JavaScript 中的函式
本文介紹瞭如何在 JavaScript 中重寫函式的概念。它還將顯示當我們在 JavaScript 中重寫函式時直譯器的行為
howto · 2023-10-12
在 Kotlin 中實現 Switch Case 語句
本文介紹如何在 Kotlin 中編寫類似 Java 的 switch-case 語句。它還將展示我們可以使用 Kotlin switch-case 語句的不同方式。
howto · 2023-01-30
在 Kotlin 中使用 by 關鍵字
Kotlin by 關鍵字是為委派目的而引入的新關鍵字。本文介紹了 by 關鍵字及其在 Kotlin 中的使用。
howto · 2023-01-30
在 Kotlin 中用值初始化陣列
本文介紹瞭如何在 Kotlin 中使用值初始化陣列的概念。我們將研究初始化陣列的不同方法。
howto · 2023-01-30
Kotlin 資料類繼承:擴充套件資料類
在本文中,我們將學習如何在 Kotlin 中擴充套件資料類。我們還將通過深入研究擴充套件資料類來學習如何宣告資料類。