What are the 'Java Data Types' and 'Access Modifiers' ???? 🤔


Java Data Types.

දත්ත ගබඩා කර තබා ගැනීමට හැකි  ආකාරයේ දේවල් Data Types ලෙස හැදින්වේ. Java Language එකෙහි ප්‍රධාන වශයෙන් Data Types 8ක් දැකිය හැක. ඒවා Primitive Data Types  ලෙස හැදින්වේ. ඒවා  ලෙස, 

  1. byte  - (Byte)   :- Numerical Value
  2. short - (Short)  :- Numerical Value
  3. int - (Integer)  :- Numerical Value
  4. long - (Long)  :- Numerical Value
  5. float - (Float)  :- Numerical Value
  6. double - (Double)  :- Numerical Value
  7. boolean - (Boolean)  :- True / False  
  8. char - (Char)  :- Character  
පෙන්වා දිය හැක. මීට අමතරව Java Language එකෙහි String නැමැති class එකක් ඇති අතර එය මගින් ද, Characters ගබඩා කළ හැකිය. නමුත් එය Primitive Data Type  එකක් නොවන අතර එය Non - Primitive Data Type එකක් වේ.

  • NUMBER SYSTEM 
Number System එකක් යනු සංඛ්‍යා පද්ධතියක්  වේ.

Ex :-  Binary , Decimal , Octal , Hexadecimal

Binary - 1 1 1 1 1 1 1 1 2

ඉහත සදහන් ද්විමය සංඛ්‍යා පද්ධතියෙහි එන 1 යන එක ඉලක්කමක්  Bit - 1 ලෙස හැදින්විය හැකිය. 

  • Data Values
8 Bit = 1 Byte
1024 Byte = 1KB
1024 KB = 1 MB
1024 MB = 1 GB
1024 GB = 1 TB 



Access Modifiers



Class / Method / Variable එකකට Access  කරන්න දෙන Security එක Modify කිරීමට යොදා ගන්නා දේවල් Access Modifiers  වේ. Java Language එකෙහි Access Modifiers වර්ග 4 දැකිය හැකිය. එනම්, 
  • Public
  • Private
  • Protected
  • Default


Ex: - 
  • public class Chamath {    }  
  • protected class Chamath {    }
  • private class Chamath {    }
  • class Chamath {    }                          - (Use as Default )

Comments

Popular posts from this blog

What are the 'Java Standards' ???? 🤔

Inheritance in java

Java Main Method and Construtor

Java Method Overloading

Abstraction in Java

Polymorphism

Encapsulation