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
document.getElementsByClassName(“className”) |
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
npm install -g @angular/cli |
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
<button onClick="satinAl()">Satın al</button> | |
<script> | |
const desteklenenOdemeYontemleri = [{ | |
supportedMethods: ['basic-card'] | |
}]; | |
const odemeDetaylari = { | |
total: { | |
label: 'Toplam', | |
amount: { |
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
// Atama işleminin gerçekleştirilmesi ile null olmayan bir değişken üretiliyor | |
var a: String = "abc" | |
a = null // Derleme hatası verir |
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
// ? operatör null olabilen bir değişken oluşturmayı sağlıyor | |
var b: String? = "abc" | |
b = null // Atamada bir problem yok | |
print(b) // Terminal çıktısı: null |
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
// Üstte "abc" değerini atadığımız a değişkeni nullable olmadığı için | |
// aşağıdaki atama bir hata vermez | |
val l = a.length |
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
/* | |
* b ifadesi null olabilen bir değişken olduğu için zaten kod yazarken dahi | |
* kodun altını kırmızı ile çizerek geliştiriciyi uyarır | |
*/ | |
val l = b.length // Hata verir | |
/* | |
* Eğer gerçekten b'nin değerini yazdırmak istiyorsak sonuna ? operatörünü koyarak | |
* çalıştırmamız gerekir. | |
*/ |
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
// Aşağıdaki gibi bir array atama fonksiyonumuz olduğunu düşünelim | |
fun copy(from: Array<Any>, to: Array<Any>) { | |
assert(from.size == to.size) | |
for (i in from.indices) | |
to[i] = from[i] | |
} | |
/* | |
* main metodunda int ve Any tipinde iki array var. | |
* Any tipindeki array'e, int array'inin atanması derleme zamanı hatası verir. |
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(args: Array<String>) { | |
// SAM kullanmadan inline bir şekilde fonksiyon tipi oluşturulabiliyor | |
val helloWorld = { x: String, y: String -> x + y } | |
print(helloWorld("Hello", " World")) // Çıktı: Hello World | |
} |
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
public interface Appendable { | |
/* | |
* Appendable sınıfından türeyen ve append metodunu kullanan her sınıf | |
* checked exceptions'tan dolayı IOException fırlatmak veya handle etmek zorundadır. | |
*/ | |
Appendable append(CharSequence csq) throws IOException; | |
} |
OlderNewer