What is data type? | Definition from TechTarget (2024)

What is a data type?

In software programming, data type refers to the type of value a variable has and what type of mathematical, relational or logical operations can be applied without causing an error. For example, many programming languages use the data type string to classify text, integer to identify whole numbers and floating point to designate numbers with decimal points.

Data typeUsed forExamples
StringAlphanumeric charactershello world
Alice
Bob123
IntegerWhole numbers7
12
999
Float (floating point)Numbers with a decimal point3.15
9.06
00.13
CharacterEncoding text numerically97 (in ASCII, 97 indicates a lowercase a)
BooleanRepresenting logical valuesTRUE
FALSE

The data type defines which operations can safely be performed to create, transform and use the variable in another computation. In most programming languages, variable values commonly possess a static type. However, the values of those static types can still exist within multiple variable classes. While some classes specify how the data type's value will be compiled or interpreted, there are other classes whose values are not marked with their class until runtime.

The extent to which a programming language discourages or prevents type error is known as type safety. When a programming language requires a variable to be used only in ways that respect its data type, that language is said to be strongly typed. If data types do not align -- such as trying to multiply an integer by a string -- a strongly typed language will likely prevent the program from running to avert potential operational errors.

Meanwhile, programming languages that allow a variable of one data type to be used as if it were a value of another data type are said to be weakly typed. While the program might be allowed to run, these data mismatches could cause eventual errors or crashes.

This was last updated in May 2023

Continue Reading About data type

Related Terms

scripting language
A scripting language is a type of programming language in which the instructions are interpreted individually at runtime.Seecompletedefinition
Spring Framework (Spring)
The Spring Framework (Spring) is an open source software development framework that provides infrastructure support for building ...Seecompletedefinition
web services
Web services are a type of internet software that use standardized messaging protocols and are made available from an application...Seecompletedefinition

Dig Deeper on Application development and design

What is data type? | Definition from TechTarget (2024)
Top Articles
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 5827

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.