Skip to content

Chamupathi Gigara's personal Blog

Just another Giga Network site

Menu
  • Blog
  • About Me
Menu

Java – Data Types

Posted on July 1, 2018July 1, 2018 by gigara

Programme ඒකක් run වෙන්න නම් අපි විවිදාකාර දත්ත(Data) එයට ලබා දිය යුතුයි. ඉතින් ඒ ලබා දෙන දත්ත සදහා විවිද වර්ග තිබෙනවා.

  • Numbers – Integer (48) and floating points (57.56)
  • Textual – characters (‘A’) and strings (“Hello”)
  • Boolean – true or false

Numeric Data (සංඛ්‍යා)

Integers – Whole numbers (පූර්ණ සංඛ්‍යා)

e.g. 25, 37, 296, 5776

Integers are of four types

byte – 8 bit

short – 16 bit

int – 32 bit

long – 64 bit

Floating point numbers – decimal numbers (දශමය සංඛ්‍යා)

e.g. 25.65, 36.75

Float – single precision – less accurate e.g. 25.5

Double – double precision – more accurate e.g. 3.142356

Texts 

char – to store single character (ඒක් අකුරක් සදහා)

e.g. ‘a’, ‘A’

String -to store any combination characters values(අකුරුු කිහිපයක්)

e.g. “Hello-123”

විශ‌ේෂිත ය‌ෙදුම්

\n – new line character

\t – tab character

\” – double quotes

\’ – single quotes

\\ – backslash

To store true / false – boolean

+ : addition

– : subtraction

* : multiplication

/ : division

% : modulus division (reminder)

Constants (නියත අගයන්)

ව‌ෙනස් න‌ොවන අගයන් ගබඩා කිරීම සදහ‌ා අප පහත පරිදි ය‌ොදාගනු ලබනවා

public static final double PI = 3.142857;

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • දේවාරූඩයෙන් Code කරන්න
  • මොනවද මේ Malware?
  • WhatsApp සදහටම නැති වෙයි?
  • Ballerina ගැන සිංහලෙන් – Ballerina in Sinhala
  • VPN ගැන ඔබ දැනුවත් ද?

Recent Comments

  • දේවාරූඩයෙන් Code කරන්න | Chamupathi Gigara's personal Blog on Ballerina ගැන සිංහලෙන් – Ballerina in Sinhala
  • Aruna Danuddara on මොනවද මේ Malware?
  • Nishiki Yapa on මොනවද මේ Malware?
  • Papaya on මොනවද මේ Malware?
  • Vidushika Ruwanpathirana on WhatsApp සදහටම නැති වෙයි?

Archives

  • February 2022
  • April 2020
  • December 2019
  • July 2019
  • April 2019
  • March 2019
  • February 2019
  • July 2018
  • March 2018
  • February 2018

Categories

  • Ballerina
  • Cyber Security
  • Java
  • Python
  • Uncategorized
© 2022 Chamupathi Gigara's personal Blog | Powered by Superbs Personal Blog theme