This repository contains Kotlin samples which demonstrates its main features, syntax, best practices and coding style. This is what I consider to be helpful for me. Probably, this can be helpful for someone else.
Some examples are taken from the "Kotlin in action" book.
Examples of Kotlin samples:
- src/main/kotlin/lesson1_hello_world_sample - hello-world sample.
- src/main/kotlin/lesson2_classes_sample - use of classes.
- src/main/kotlin/lesson3_statements_sample - use of statements and operators.
- src/main/kotlin/lesson4_exceptions - use of exceptions.
- src/main/kotlin/lesson5_functions - use of functions.
- src/main/kotlin/lesson6_classes - use of different declaration of classes.
- src/main/kotlin/lesson7_class_constructors - use of primary constructors.
- src/main/kotlin/lesson8_secondary_constructor - use of secondary constructors.
- src/main/kotlin/lesson9_object_declaration - use of "object" keyword.
- src/main/kotlin/lesson10_lambda_expressions - use of lambda.
- src/main/kotlin/lesson11_lambda_collections - use of lambda in collections.
- src/main/kotlin/lesson12_regular_expressions - use of regular expressions.
- src/main/kotlin/lesson13_null_safety - use of null expressions.
- src/main/kotlin/lesson14_special_types - use of special types.
- src/main/kotlin/lesson15_collections - use of collections.
- src/main/kotlin/lesson16_delegation - use of delegation.
- src/main/kotlin/lesson17_operators - use of operators.
- src/main/kotlin/lesson18_high_order_function - use of high order functions.
- src/main/kotlin/lesson19_scope_function - use of scope functions.
- src/main/kotlin/lesson20_generics - use of generics.
Examples of design patterns:
- src/main/kotlin/design_patterns/bridge - bridge example.
- src/main/kotlin/design_patterns/publisher_subscriber - observer example.
- src/main/kotlin/design_patterns/state - state example.
- src/main/kotlin/design_patterns/state_machine - state machine example.
- src/main/kotlin/design_patterns/chain_of_responsibilities - chain of responsibilities example.
- src/main/kotlin/design_patterns/command - command example.
Samples for play ground:
- src/main/kotlin/samples/custom_number_class
- src/main/kotlin/samples/delegation_example
- src/main/kotlin/samples/regular_expressions
The list is going to be updated and extended.