ජාවා with නානා(part 7)

Share

කට්ටිය Theory වලට වැඩිය කැමති නැතුව ඇති. ඒත් ඉතින් මොනවා කරන්නද? මෙවත් ඉගෙන ගන්න එපැයි. අද අපි කථා කරන්නේ Variables සහ Data Types ගැන. එහෙනන් අපි පටා…….න් ගමු.

    Variables and Data types

1) Variables are locations in memory in which values can be stored.
2) Each variable has a Data type, name and a value.
3) A variable Data type defines what type of data it can store.

    Data types

1) The data type of a variable can be either a primitive data type, Reference data type or Array data type.
2) Variables with primitive data type store simple data like integers, reals, Booleans and characters.
3) Variables with Reference data types stores java objects that are instances of classes.
4) variables with Array data types stores data of that particular array type.

මේ කොටස් හොදටම මතක තියාගන්න.මේ කොටස නන් අනිවාර්‍යයෙන් exam එකෙදී අහනවා.

    PRIMITIVE Data Types

# 8 primitive data types
# 4 types of integers
1. byte – 8 bits
2. short- 16 bits
3. int – 32 bits
4. long – 64 bits

# 2 types of real numbers
1. float – 32 bits
2. double- 64 bits

# char
1. stores a single character.
2. E.g.- ‘a’, ‘i’
3. 16 bits.

# boolean
1. stores a boolean value.
2. E.g.- true, false

අපි ඊලග tutorial එකෙන් බලමු කොහොමද variables හදුන්වා දෙන්නේ සහ ඒවාට අගයන් ආදේශ කරන්නේ කියලා.

මොකක් හරි අවුලක් තියනවනම්

e-mail- charith_shaddow@yahoo.com
Facebook- charith shadow Winchester (naana)
දෙකෙන් එකකට message එකක් දාන්න.