Skip to content

Instantly share code, notes, and snippets.

@egeysn
Last active July 18, 2020 14:11
Show Gist options
  • Save egeysn/b6be2e02528acfdaa6cf790dfcc03635 to your computer and use it in GitHub Desktop.
Save egeysn/b6be2e02528acfdaa6cf790dfcc03635 to your computer and use it in GitHub Desktop.
fun outerFunction(nice: String) {
val hello = "Hello, Medium"
fun innerFunction(awesome: String) {
println(awesome)
//Bu kısımdan outerFunction'un "nice" değişkenine erişebiliriz.
println(nice)
// Ayrıca bu kısımdan outerFunction'a ait olan "hello" değişkenine erişim sağlayabiliriz.
println(hello)
}
// outerFunction içerisinde innerFunction çağrılıyor.
innerFunction(" I'm innerFunction")
}
fun main(args: Array<String>) {
// outerFunction'a erişim sağlayabiliriz fakat outerFunction içinde ki
//innterFunction'a erişim sağlayamayız.
outerFunction("I'm calling outerFunction in main()")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment