Skip to content

SerhiiButryk/KotlinSamples

Repository files navigation

Kotlin samples

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:

  1. src/main/kotlin/lesson1_hello_world_sample - hello-world sample.
  2. src/main/kotlin/lesson2_classes_sample - use of classes.
  3. src/main/kotlin/lesson3_statements_sample - use of statements and operators.
  4. src/main/kotlin/lesson4_exceptions - use of exceptions.
  5. src/main/kotlin/lesson5_functions - use of functions.
  6. src/main/kotlin/lesson6_classes - use of different declaration of classes.
  7. src/main/kotlin/lesson7_class_constructors - use of primary constructors.
  8. src/main/kotlin/lesson8_secondary_constructor - use of secondary constructors.
  9. src/main/kotlin/lesson9_object_declaration - use of "object" keyword.
  10. src/main/kotlin/lesson10_lambda_expressions - use of lambda.
  11. src/main/kotlin/lesson11_lambda_collections - use of lambda in collections.
  12. src/main/kotlin/lesson12_regular_expressions - use of regular expressions.
  13. src/main/kotlin/lesson13_null_safety - use of null expressions.
  14. src/main/kotlin/lesson14_special_types - use of special types.
  15. src/main/kotlin/lesson15_collections - use of collections.
  16. src/main/kotlin/lesson16_delegation - use of delegation.
  17. src/main/kotlin/lesson17_operators - use of operators.
  18. src/main/kotlin/lesson18_high_order_function - use of high order functions.
  19. src/main/kotlin/lesson19_scope_function - use of scope functions.
  20. src/main/kotlin/lesson20_generics - use of generics.

Examples of design patterns:

  1. src/main/kotlin/design_patterns/bridge - bridge example.
  2. src/main/kotlin/design_patterns/publisher_subscriber - observer example.
  3. src/main/kotlin/design_patterns/state - state example.
  4. src/main/kotlin/design_patterns/state_machine - state machine example.
  5. src/main/kotlin/design_patterns/chain_of_responsibilities - chain of responsibilities example.
  6. src/main/kotlin/design_patterns/command - command example.

Samples for play ground:

  1. src/main/kotlin/samples/custom_number_class
  2. src/main/kotlin/samples/delegation_example
  3. src/main/kotlin/samples/regular_expressions

The list is going to be updated and extended.

About

KotlinExamples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published