Javatpoint Logo
Javatpoint Logo

Data Types

A data type classifies various types of data, for example, string, integer, boolean, float, and the types of accepted values for that data type, operations that can be performed on the data type, the meaning of the data of that type can be stored.

int: This data type is used to store 32 bits integer numbers. This data type stores positive or negative whole numbers.

float: The float data type is used to store floating point numbers. The float data type is the default type of number in Unity.

For Example:

double: Double data type also stores floating point numbers, but it can hold larger size numbers than float. And it is not the default number type in Unity.

For Example:

bool: The bool data type is the short form of Boolean. This data type store true or false values.

For example:

char: This data type stores a single character such as a number, letter, space, or special character. A char value should be written in single quotes.

For example:

string: This data type is used to store letters, numbers, and other special characters in the form of words or sentences. A string value should be written inside double quotes.

For example:

Example

Let's see one simple example:

Output:

Data Types
Next TopicClasses




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA