Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Kotlin be defined a strongly typed language?

From the definition of strongly-typed language:

A strongly-typed programming language is one in which each type of data (such as integer, character, hexadecimal, packed decimal, and so forth) is predefined as part of the programming language and all constants or variables defined for a given program must be described with one of the data types (source)

From kotlin documentation, I can understand that kotlin is a statically typed language because the type of the variable is known at compile time, but what about strongly or weakly typed? I can't find any clear response googling. As far as I understood Kotlin should be equally strongly typed as Java because it compiles down to Java byte code, but I'm not 100% sure. Please help me to understand if I'm on the right way.

like image 950
Nicola Gallazzi Avatar asked Dec 13 '22 13:12

Nicola Gallazzi


1 Answers

Weakly-typed languages feature implicit conversions between incompatible types while strongly-typed languages disallow it.

Kotlin doesn't feature implicit conversions between types - which makes it strongly statically typed.

like image 171
Grzegorz Piwowarek Avatar answered Dec 17 '22 22:12

Grzegorz Piwowarek