This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| // jenny is the new object | |
| Human jenny = Human(startingHeight: 15, weight: 3.5); | |
| // .height accessing height property | |
| // this object.get this property | |
| print(jenny.height); | |
| jenny.height = 20; | |
| print(jenny.height); | |
| // .talk triggers the talk method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| } | |
| // if (condition) {instruction} | |
| // == means is or is equal to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math'; | |
| void main() { | |
| loveCalculator(); | |
| } | |
| // if (condition) {instruction();} | |
| // else {instruction();} | |
| // == means is or is equal to | |
| // != not equal to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Arguments/parameters are values passed into a function | |
| * two kinds of A/p's are accepted in functions (Positional and Named) | |
| * function then uses those values to carry out provided instructions | |
| * (display on screen, use in a calculation, or send to another function) | |
| * | |
| * add is Positional required | |
| * addTwo is Named optional | |
| * addThree is Positional optional | |
| * addFour is Named with default values | |
| * addFive is Named parameters required |
OlderNewer