This file contains hidden or 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 employee = Employee("PIG",500) | |
| } | |
| class Employee (var name:String,var id : Int){} |
This file contains hidden or 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>) { | |
| // nullability() | |
| // if_statement() | |
| // flow_based_typing() | |
| // for_loop() | |
| when_repression() | |
| } | |
| fun get_country_code()=33 | |
| fun when_repression(){ | |
| val code =0 |
This file contains hidden or 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>) { | |
| // nullability() | |
| // if_statement() | |
| // flow_based_typing() | |
| // for_loop() | |
| when_repression() | |
| } | |
| fun get_country_code()=33 | |
| fun when_repression(){ | |
| val code =0 |
This file contains hidden or 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>) { | |
| // nullability() | |
| // if_statement() | |
| // flow_based_typing() | |
| // for_loop() | |
| when_repression() | |
| } | |
| fun get_country_code()=33 | |
| fun when_repression(){ | |
| val code =33 |
This file contains hidden or 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>) { | |
| // nullability() | |
| // if_statement() | |
| // flow_based_typing() | |
| // for_loop() | |
| when_repression() | |
| } | |
| fun get_country_code()=33 | |
| fun when_repression(){ | |
| val code =33 |
This file contains hidden or 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>) { | |
| // nullability() | |
| // if_statement() | |
| // flow_based_typing() | |
| // for_loop() | |
| when_repression() | |
| } | |
| fun when_repression(){ | |
| val code =44 | |
This file contains hidden or 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>) { | |
| // nullability() | |
| // if_statement() | |
| // flow_based_typing() | |
| for_loop() | |
| } | |
| fun for_loop(){ | |
| for (a in (10 downTo 1)) print("$a\t") | |
| println() | |
| println("====我是分隔線====") |
This file contains hidden or 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>) { | |
| // nullability() | |
| // if_statement() | |
| // flow_based_typing() | |
| for_loop() | |
| } | |
| fun for_loop(){ | |
| for (a in (10 downTo 1)) print("$a\t") | |
| println() | |
| println("====我是分隔線====") |
This file contains hidden or 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>) { | |
| // nullability() | |
| // if_statement() | |
| // flow_based_typing() | |
| for_loop() | |
| } | |
| fun for_loop(){ | |
| for (a in (10 downTo 1)) print("$a\t") | |
| println("====我是分隔線====") | |
| } |
This file contains hidden or 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>) { | |
| // nullability() | |
| // if_statement() | |
| flow_based_typing() | |
| } | |
| fun flow_based_typing() { | |
| var s: String? = "segsg" | |
| // println(s.length) |