-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDart.dart
31 lines (26 loc) · 1.25 KB
/
Dart.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//Introduction
/*Dart is used for App development on FLutter
Flutter is a universal app framework for iOS, Android, and Web Apps*/
//Hello World
void main(){ //main() is a predefined method in Dart - and acts as an entry point to the application. void is the Return Type - and means we won't return anything. Dart needs these to run.
print("Hello World!"); //Fairly straightforwards - this prints whatever is within the brackets
}
//This will output "Hello World!" You'll notice the syntax is similar to C, C++, and Java
//Comments
//Single Line - Use "//"
/*Multi-Line - Use "/*" to start. This is the start of a multi line comment
This is the end of the same multi line comment.*/
//Variables
var name = "Smith"; //Here the Variable "name" has "Smith" stored
//Data Types
//Dart Supports the following types of variable
//Numbers - an integer (A non-fractional value - a whole number) or a "Double" (a fractional value - with decimal points)
int age = 25;
double piggybank = 15.60;
//Strings - A string of Characters
String cheese = "Brie";
//Booleans - true/false
bool isHappy = true;
//Lists -
//Maps -
//Type checking ensures that a variable holds only data specific to a data type, for instance you cannot keep a String inside an integer variable.