- Inheritance is one of the key concepts in object-oriented programming that helps in avoiding code repetition, especially where different classes have common features and all the classes belong to the same type
- Encapsulation is an object-oriented programming technique that involves binding data and functions into one unit, which is called a class. All properties and functions of the class are tightly coupled and combined in a single place.
- A visibility modifier helps to set the visibility of functions and properties to achieve encapsulation. A rule of thumb of encapsulation is to restrict those properties accessible to the outside the world and instead implement some functions to access them indirectly. Public, private, protected, and internal are four visibility modifiers provided by Kotlin.
- Kotlin provides four different types of inheritance:
- Single inheritance ...
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia