Constructor

Kotlin Constructor

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. Constructor A constructor for a class is a special member function, mainly used to initialize the properties of the newly created object of that class type. It is called implicitly, […]

Kotlin Constructor Read More »

Java Constructors

In this article, you’ll learn about Java constructors, how to create and use constructors with the help of examples. Constructor A constructor is a member function of a class with the same name as its class and has no return type. A constructor for a class is a special method that is used to initialize

Java Constructors Read More »