Kotlin Visibility Modifiers In this article, you will learn about all 4 visibility modifiers in Kotlin and how they work in different scenarios. Visibility modifiers are keywords that set the visibility (accessibility) of classes, objects, interface, constructors, functions, properties and their setters. (You cannot set visibility modifier of getters as they always take the same visibility …
Kotlin Inheritance In this article, you’ll learn about inheritance. More specifically, what is inheritance and how to implement it in Kotlin (with the help of examples). Inheritance is one of the key features of object-oriented programming. It allows user to create a new class (derived class) from an existing class (base class). The derived class …
Kotlin Getters and Setters In this article, you will learn to use getters and setters in Kotlin with the help of an example. Before you learn about getters and setter, be sure to check Kotlin class and objects. In programming, getters are used for getting value of the property. Similarly, setters are used for setting value of …
Kotlin Constructors In this article, you will learn about constructors in Kotlin (both primary and secondary constructors) as well as initializer blocks with the help of examples. A constructor is a concise way to initialize class properties. It is a special member function that is called when an object is instantiated (created). However, how they work in …
Kotlin Class and Objects In this article, you’ll be introduced to Object-oriented programming in Kotlin. You’ll learn what a class is, how to create objects and use it in your program. Kotlin supports both functional and object-oriented programming. Kotlin supports features such as higher-order functions, function types and lambdas which makes it a great choice for working in functional programming …
Kotlin Recursion (Recursive Function) and Tail Recursion In this article, you will learn to create recursive functions; a function that calls itself. Also, you will learn about tail recursive function. A function that calls itself is known as recursive function. And, this technique is known as recursion. A physical world example would be to place two parallel …
Kotlin Default and Named Arguments In this article, you will learn about default and named arguments with the help of examples. Kotlin Default Argument In Kotlin, you can provide default values to parameters in function definition. If the function is called with arguments passed, those arguments are used as parameters. However, if the function is …
(How to setup Dropout Regularization in Keras) In this Learn through Codes example, How to setup Dropout Regularization in Keras in Python. How_to_setup_Dropout_Regularization_in_Keras Python Example for Beginners Special 95% discount 2000+ Applied Machine Learning & Data Science Recipes Portfolio Projects for Aspiring Data Scientists: Tabular Text & Image Data Analytics as well as Time …
Kotlin Infix Function Call In this article, you will learn to use infix notation to call a function in Kotlin (with the help of examples). Before you learn how to create a function having infix notation, let’s explore two commonly used infix functions. When you use || and && operations, the compiler look up for or and and functions respectively, and calls them …
Kotlin Functions In this article, you’ll learn about functions; what functions are, its syntax and how to create a user-function in Kotlin. In programming, function is a group of related statements that perform a specific task. Functions are used to break a large program into smaller and modular chunks. For example, you need to create …