Common Primitive Data Types in Programming
Some common primitive datatypes are as follow:
Data Type | Definition | Examples |
---|---|---|
Integer (int) | represent numeric data type for numbers without fractions |
300, 0 , -300 |
Floating Point (float) | represent numeric data type for numbers with fractions |
34.67, 56.99, -78.09 |
Character (char) | represent single letter, digit, punctuation mark, symbol, or blank space | a , 1, ! |
Boolean (bool) | True or false values | true- 1, false- 0 |
Date | Date in the YYYY-MM-DD format (ISO 8601 syntax) |
2024-01-01 |
Time | Time in the hh:mm:ss format for the time of day, time since an event, or time interval between events |
12:34:20 |
Datetime | Date and time together in the YYYY-MM-DD hh:mm:ss format |
2024 -01-01 12:34:20 |
Data Types in Programming
In Programming, data type is an attribute associated with a piece of data that tells a computer system how to interpret its value. Understanding data types ensures that data is collected in the preferred format and that the value of each property is as expected.
Table of Content
- What are Data Types in Programming?
- Common Data Types in Programming
- Common Primitive Data Types in Programming
- Common Composite Data Types
- Common User-Defined Data Types
- Dynamic vs Static Typing in Programming
- Type Casting in Programming
- Variables and Data Types in Programming
- Type Safety in Programming
Contact Us