ยกเว้นการจัดการ kotlin

รหัสตัวอย่าง

3
0

พยายามจับ kotlin

try{
  // wirte here somethin that you thought it would throw expection
}
catch(e:Expection){ 
  e.printstacktrace() 
  // handle expection or write upper line of code
}
finally{
	// this block is optional 
  	// this will always run if expection come or not
}
1
0

kotlin โยนข้อยกเว้น

throw Exception("Exception message")

หน้าคล้ายกัน

คล้ายกันหน้ากับตัวอย่าง

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................