Kotlin Advanced Programming

A journey from Kotlin Basics to Advanced level

Satya Pavan Kantamani
Programming Geeks

--

If you are new to Kotlin please check out my previous post on Kotlin Guide for Beginners first before moving forward for better understanding. In this post let’s check some basics and a few interesting things about functions in Kotlin.

How to write functions or methods in Kotlin?

A function is nothing but a collection of statements. A function needs to be called explicitly to execute that block of statements. To maintain readability and ease of understanding, we write n number of functions in our classes. Methods are used to perform certain actions.

A function must be declared within a class. To declare a method in Kotlin we mainly need three different parameters

  • fun — In Kotlin functions are declared with the fun keyword
  • name — We need to have a unique name for each method
  • ()parenthesis which common for method declarations across most of the programming languages

--

--

Satya Pavan Kantamani
Programming Geeks

Android Dev, Interested in Traveling, App development. Based in Hyderabad, India. Catch me at https://about.me/satyapavankumar