Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

What Is Data Type in Java

Data type in Java ko hum kahein toh yeh ek prakar ka classification hai jo batata hai ki ek variable kis tarah ke data ko store kar sakta hai. Seedhe shabdon mein, yeh specify karta hai ki ek variable kis tarah ke values ko hold kar sakta hai. Yahaan kuch common data types hain Java mein:

  1. int (Integer): Poore numbers (integers) ko store karne ke liye istemal hota hai, jisme koi decimal point nahi hota. Example:

   int age = 25;

  1. double: Decimal points ke saath numbers ko store karne ke liye istemal hota hai. Example:

   double salary = 50000.50;

  1. char (Character): Ek single character ko store karne ke liye istemal hota hai, jo single quotes mein hota hai. Example:

   char grade = 'A';

  1. boolean: true ya false values ko store karne ke liye istemal hota hai. Example:

   boolean isStudent = true;

  1. String: Yeh primitive data type nahi hai, lekin widely istemal hota hai sequences of characters (text) ko store karne ke liye. Example:

   String name = "John";

Yeh data types yeh ensure karte hain ki variable ko assign ki gayi value uski type ke saath compatible hai, jisse program ki integrity bani rahe.

Leave a comment