What is the default visibility modifier and also list the different types of modifiers?
Answer / Ankush Gupta
In Kotlin, the default visibility for functions, properties, and constructors is public. The other visibility modifiers are private, protected, internal, and open. For types (classes, objects, interfaces), the default visibility is public and the other visibility modifier is internal.
| Is This Answer Correct ? | 0 Yes | 0 No |
How to declare a Kotlin variable?
Can Kotline offer any additional functionality for standard Java packages or standard Java classes?
What is the Target Platform of Kotlin? How is Kotlin-Java interoperability possible?
List the number of constructors available in Kotlin?
Can you migrate the code from java to kotlin? If yes how do you do it?
How do you declare a variable in kotlin?
Give a syntax for declaring a variable as volatile in Kotlin?
Define when expression?
Is there any Ternary Conditional Operator in Kotlin like in Java?
Why to use kotlin?
How are Primary Constructors different from Secondary Constructors ?
Give example to declare variable using both val and var in Kotlin?