Difference between revisions of "Constants - Variables - Data Types"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
Line 1: Line 1:
 
There are 9 types of data types. These include boolean, string, integer, double, decimal, character,  byte, float and long.
 
There are 9 types of data types. These include boolean, string, integer, double, decimal, character,  byte, float and long.
  
*Boolean is a binary value, being either true or false.  
+
*Boolean is a binary value, being either true or false.
 +
 
 +
<syntaxhighlight lang="csharp" line>
 +
bool test = true;
 +
 
 +
</syntaxhighlight>
 +
 
 
*String is used for storing characters in word form.  
 
*String is used for storing characters in word form.  
 
*Integer is used to store whole numbers (32 bit values).
 
*Integer is used to store whole numbers (32 bit values).

Revision as of 10:36, 15 December 2016

There are 9 types of data types. These include boolean, string, integer, double, decimal, character, byte, float and long.

  • Boolean is a binary value, being either true or false.
1  
2 bool test = true;
  • String is used for storing characters in word form.
  • Integer is used to store whole numbers (32 bit values).
  • Double is used to store numbers where there are numbers before and after the decimal point.
  • decimal is used for numbers only after the decimal point.
  • Character is used to store single letters.
  • Byte is used to store a byte( eight 1's or 0's).
  • Float is used to store a set number of digits after a decimal place.
  • Long integer is also used to store whole numbers (However these are 64 bit values).