Skip to content

Instantly share code, notes, and snippets.

View ibrahimethemsen's full-sized avatar
🎯
Odaklanma

İbrahim Ethem Şen ibrahimethemsen

🎯
Odaklanma
View GitHub Profile

Kotlin Mülakat Hazırlık

1- var ile val nedir, ne amaçla kullanılır?

  • val, değiştirilemeyen yani immutable değişkenler için kullanılır.
  • var, değiştirilebilir yani mutable değişkenler için kullanılır.

2- open keyword ne işe yarar?

Kotlin dilinde her şey final’dır, yani değiştirilemez. Bu yüzden kullanılmak istenen sınıfların ve fonksiyonların önüne open keyword yazılmalıdır.

@championswimmer
championswimmer / runtime-annotation-kotlin.md
Last active July 29, 2023 12:50
Runtime @annotation Processing using Reflection in Kotlin

Runtime @Annotation Processing using Reflection in Kotlin

Let us take a look at Annotations in Kotlin, and start with a simple example of processing annotations at runtime using JVM's reflection framework.

NOTE: This is shown in Kotlin, but is specific to how Kotlin/JVM works, and is not applicable to Kotlin/JS or Kotlin/Native.

Creating an Annotation

First of all, we create annotations in Kotlin using the keywords annotation class.