mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
miguel
8f241a0a84
|
2 years ago | |
---|---|---|
.. | ||
README.md | 2 years ago |
README.md
Variables
Instructions
Declare and initialize following variables:
obj
of typeObject
containing any value;planet
of typeString
containing planet's name you live on;year
of typeint
containing current year;lucky
of typebool
containing true of false (you decide);pi
which is a constant of typedouble
containing the value of pi with 2 decimal points;
Hints
There are two ways to declare variables in Dart:
var strPatrick = 'Patrick';
String strSpongebob = 'Spongebob';
- The first way declares using
var
which detects variable types automatically. - The second way explicitly declares the variable's type using the appropriate keyword, such as
String
for strings, as shown in the example.
Note: main is not needed!