Data types in Java for Beginners| What is Data Types | Basic Java Programming | Hindi

Published: 06 January 2024
on channel: Java Programming
37
11

Data Types And Variable
What are Java data types, and how are they grouped?
In Java, a variable must be a specified data type such as an integer, floating-point number, character Boolean, or string.
The two groups of data types are:
Primitive data types
which include byte, short, int, long, float, double, Boolean, and char
Non-primitive data types,
which include string, arrays, and classes
How do you define primitive data types and describe each by size and description?
byte is 1 byte in size.
It stores whole numbers from -128 to 127

short is 2 bytes in size.
It stores whole numbers from -32,768 to 32,767

int is 4 bytes in size.
It stores whole numbers from -2,147,483,648 to 2,147,483,647

long is 8 bytes in size.
It stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

float is 4 bytes in size
It stores fractional numbers and is sufficient for storing 6 to 7 decimal digits.
Float Salary = 15000.00f

Double is 8 byte in Size
It stores fractional numbers and is sufficient for storing 15 decimal digits.

Boolean is 1 bit in size.
It stores true or false values.

char is 2 bytes in size.

   • Best Debugging Tips  Beginners | How ...  
   • How to Print Pattern In Java | Full P...  
   • How to Print Pattern In Java | Full P...  
   • Break and Continue || Break || Contin...  
   • Do While Loop || Loop || Java  
   • For Loop || Loop || Java  
   • How to Print Fibonacci Series || Fibo...  
   • How Printing  Solid Square Pattern  i...  


On this page of the site you can watch the video online Data types in Java for Beginners| What is Data Types | Basic Java Programming | Hindi with a duration of hours minute second in good quality, which was uploaded by the user Java Programming 06 January 2024, share the link with friends and acquaintances, this video has already been watched 37 times on youtube and it was liked by 11 viewers. Enjoy your viewing!