This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val immutablevalue = "Değişmez Değişken" | |
var mutableVariable = "Değişebilir Değişken" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun merhaba(): String { | |
return "merhaba" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
kareAl(2) | |
val kare = kareAl(2) | |
} | |
fun kareAl(sayi: Int): Int { | |
return sayi * sayi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
message("EMRE") | |
message("EMRE", 20) | |
//message(20) ad parametresine deger girmek zorunlu | |
} | |
fun message(ad: String, yas: Int = 0) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
//message("emre",true) burada ogrenci degiskenine deger gönderdiğimizi anlamıyor | |
message("emre", ogrenci = true) | |
message(ad = "emre", ogrenci = true) | |
} | |
fun message(ad: String, yas: Int = 0, ogrenci: Boolean) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
getUserInfo("1", "2", "3", "4", key = 22) | |
} | |
fun getUserInfo(vararg userInfo: String, key: Int) { | |
userInfo[3] | |
userInfo.get(3) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
val test = Test() | |
test ekranaYaz "selam" | |
} | |
class Test { | |
infix fun ekranaYaz(metin: String) { | |
return print(metin) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
3.topla(5) | |
} | |
fun Int.topla(sayi: Int) { | |
return println(this + sayi)// this =3 , sayi=5 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
3 topla 5 | |
} | |
infix fun Int.topla(sayi: Int) { | |
return println(this + sayi)// this =3 , sayi=5 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
val test = Test() | |
test.main() | |
} | |
class Test { | |
fun main() { | |
3 topla 5 | |
} |
OlderNewer