Skip to content
← Back to glossary

データ型Data Type

Learn in the textbookData Types

DefinitionA data type (データ型) is a classification that fixes what kind of data a variable or value represents, along with the range of values it can take and the operations it allows.

ExplanationOnce the type is set, it determines how the value is stored in memory, how large a range of values fits, and which operations can be applied. This unit covers 4 basic types: integer, real, Boolean and character. Giving each variable a type makes it easier to catch the mistake of storing a value of the wrong kind.

AnalogyIt is like labeling each drawer of a filing cabinet with the kind of item it may hold. Because of that rule, you always know how to handle whatever you take out.

Memory hookThe Japanese 型 (kata) is simply a translation of "type", which means a kind or category.