INFINI LEARN

Infini Learn blogging is a very good medium which imparts knowledge in a structured manner which is accurate, precise and useful. It helps in enhancing your knowledge and gives you an opportunity to learn about new topics and skills. With this, you not only become relevant in your job market, but can also make a significant contribution to your personal development and society. Through Infini Learn Blogging, you can gain knowledge on topics according to your interest,

Translate

Monday, 10 July 2023

Primitive data types

 In Java, variables are used to store data values that can be manipulated by the program. There are several data types in Java, including:

Primitive data types:

byte: 8-bit integer

short: 16-bit integer

int: 32-bit integer

long: 64-bit integer

float: 32-bit floating-point number

double: 64-bit floating-point number

boolean: true/false value

char: single character

Non-primitive data types:


String: a sequence of characters

Arrays: a collection of similar data types

Classes: user-defined data types

To declare a variable in Java, you need to specify the data type and give it a name. For example:


int age = 27;

boolean isStudent = true;

double height = 1.75;

String name = "InfiniLearn";


In this example, we have declared four variables: age, isStudent, height, and name. The data types of the variables are int, boolean, double, and String, respectively. In Java, variable names are case-sensitive and must begin with a letter, underscore, or dollar sign.

No comments:

Post a Comment

ओशो का जीवन परिचय | Osho Biography in Hindi

ओशो का जीवन परिचय | Osho Biography in Hindi ओशो एक ऐसे आध्यात्मिक गुरू रहे हैं, जिन्होंने ध्यान की अतिमहत्वपूर्ण विधियाँ दी। ओशो के चाहने वा...

new one