What are data types…
 
Notifications
Clear all

What are data types?

4 Posts
5 Users
5 Likes
322 Views
0
Topic starter

Define the basic Data types.

bathri1130 bathri1130 06/03/2023 2:32 pm

@bharatupadhyay Unlike humans, a computer does not know the difference between “1234” and “abcd.” A data type is a classification that dictates what a variable or object can hold in computer programming. Data types are an important factor in virtually all computer programming languages

Common examples of data types
Boolean (e.g., True or False)
Character (e.g., a)
Date (e.g., 03/01/2016)
Double (e.g., 1.79769313486232E308)
Floating-point number (e.g., 1.234)
Integer (e.g., 1234)
Long (e.g., 123456789)
Short (e.g., 0)
String (e.g., abcd)
Void (e.g., no data)

Topic Tags
3 Answers
2

A data type, in programming, is a classification that specifies which type of value a variable has and what type of mathematical, relational or logical operations can be applied to it without causing an error.

2
A particular kind of data item, as defined by the values it can take, the programming language used, or the operations that can be performed on it.
1

A datatype is a classification that specifies the type of value/data that a variable holds. 

Datatypes can be classified into two types:

  • Primitive
    1. String: “Akshaj”, “hello”
    2. Number: 45, 9.2, 1
    3. Boolean: True, False
    4. Null
    5. Undefined: No value has been assigned
    6. Symbol
  • Non-primitive
    1. Object: Person = {age: 21, name: “akshaj”}
    2. Array: numbersTillFive = [0,1,2,3,4,5]
    3. Function: drawCircle()

The above given datatypes are for JavaScript. They may vary language to language. 

This post was modified 2 years ago by akshajsrivastava
Share: