Data Types:
Data Types ko samajhne se pehle apko Variables ka samajhna zarori hai. Behtar hai aap iss series ka Part 3 pehle parh lain.
Hum samajhne ke liye Variables ko kapray dhonay ki baltiyaan soch sakte hain. In baltiyon mein hum kapray(data) store karte hain processing ke liye.
Jaisay ke humare kapre mukhtalif kisam ke hota hain issi tarah data bhi mukhtalif kisam ka hota hai. Data ki inn mukhtalif kismo ko hum Data Types kehte hain.
Ab mere jaisa zara bewakoof banda pochay ga ke "Mukhtalif data types ki akhir zarorat kiya hai?"
Iss sawal ka jawab balti ke kapron mein chupa hai. Imagine karein, apke paas mukhtalif tarah ke kapray hain. For example, sweaters, fancy kapray aur cotton (kalaf walay) kapray.
Inn sab mukhtalif kapron ko dhonay ke tarikay bhi aik dosre se farq hain. Iss liye humein chahiye aik balti mein aik hi kisam ke kapray daalain. Matlab, aik balti mein sirf sweaters, aik mein fancy kapray aur aik balti mein cotton walay kapray.
Bilkul issi tarah aik Variable mein aik kisam(Data Type) ka data store karna hota hai.
For example,
Integer number = 123
String name = "abcd"
Upar diye huwe Variable "number" mein hum sirf Integer data type ka data store kar sakte hain. Issi tarah String data type sirf jumlay (Text or Words) store karne ke liye use ho sakti hai.
Kuch common Data Types yeh hain:
- Boolean (e.g., True or False)
- Character (e.g., a)
- Double (e.g., 1.79769313486232E308)
- Floating-point number (e.g., 1.234)
- Integer (e.g., 1234)
- String (e.g., abcd)
Top comments (0)