What are the 'Java Data Types' and 'Access Modifiers' ???? 🤔
Java Data Types.
දත්ත ගබඩා කර තබා ගැනීමට හැකි ආකාරයේ දේවල් Data Types ලෙස හැදින්වේ. Java Language එකෙහි ප්රධාන වශයෙන් Data Types 8ක් දැකිය හැක. ඒවා Primitive Data Types ලෙස හැදින්වේ. ඒවා ලෙස,
- byte - (Byte) :- Numerical Value
- short - (Short) :- Numerical Value
- int - (Integer) :- Numerical Value
- long - (Long) :- Numerical Value
- float - (Float) :- Numerical Value
- double - (Double) :- Numerical Value
- boolean - (Boolean) :- True / False
- char - (Char) :- Character
- NUMBER SYSTEM
Ex :- Binary , Decimal , Octal , Hexadecimal
Binary - 1 1 1 1 1 1 1 1 2
ඉහත සදහන් ද්විමය සංඛ්යා පද්ධතියෙහි එන 1 යන එක ඉලක්කමක් Bit - 1 ලෙස හැදින්විය හැකිය.
- Data Values
1024 Byte = 1KB
1024 KB = 1 MB
1024 MB = 1 GB
1024 GB = 1 TB
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
Post a Comment