Member-only story

Kotlin Advanced Programming Part 2

Satya Pavan Kantamani
4 min readJul 4, 2020

--

A journey to Kotlin Functional Programming

If you are new to Kotlin please check out my previous posts Kotlin Guide for Beginners and Kotlin Advanced Programming and move forward for better understanding. In this post let’s check some advanced concepts related to the functional programming of Kotlin.

Unit-returning functions

In Kotlin every function has function type. If the function returns nothing then the function return type is Unit. It’s optional to specify the Unit return type explicitly. It’s similar to void in the case of Java.

Functions with Varargs

A function that accepts a variable number of arguments (varargs).

The above function can be called by passing n number of params of type T

--

--

Satya Pavan Kantamani
Satya Pavan Kantamani

Written by Satya Pavan Kantamani

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

Responses (1)