Locked lesson.
About this lesson
We introduce many of the Data Types you can use: Strings, Char, Int, float, double, decimal, and boolean.
Exercise files
Download this lesson’s related exercise files.
6 - Data Types.docx60.7 KB 6 - Data Types SOLUTION.docx
57.6 KB
Quick reference
Data Types: Strings, Char, Int, float, double, decimal, boolean
Variables hold data types - which are simply types of data.
When to use
Any time you need to chategorize data, you'll use a data type.
Instructions
char myChar = "J";
string myString "John Elder";
int myInt = 41;
float myFloat = 19.95f;
double myDouble = 21.14d;
decimal myDecimal = 99.98m;
Boolean myBool = true;
Hints & tips
- The main data types are char, string, int, float, double, decimal, and Boolean
- There are more data types, but these are the main ones you'll use most often.
Lesson notes are only available for subscribers.