What are the key aspects of a strongly typed language?

前端 未结 8 2095
后悔当初
后悔当初 2020-12-09 17:26

What makes a language strongly typed? I\'m looking for the most important aspects of a strongly typed language.

Yesterday I asked if PowerShell was strongly typed, b

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 17:51

    Strongly typed means you declare your variables of a certain type, and your compiler will throw a hissy fit if you try to convert that variable to another type without casting it.

    Example (in java mind you):

    int i = 4;
    char s = i; // Type mismatch: cannot convert from int to char
    

提交回复
热议问题