Читать книгу Beginning Programming All-in-One For Dummies - Wallace Wang - Страница 67

IT’S TYPE-SAFE

Оглавление

A second advantage of C# is that it’s a type-safe language. Basically, if a C# program stores data, such as a whole number (such as 3 or 49, but not 5.48), the C# compiler checks to make sure no other part of the program accidentally changes that whole number into a decimal.

With languages that aren’t type-safe, the compiler lets a program change data types, such as storing a decimal or negative number where the program expects a whole number. Obviously, if your program is expecting a whole number but instead receives a decimal number, the program may get confused and crash.

Beginning Programming All-in-One For Dummies

Подняться наверх