Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 553 Bytes

global.md

File metadata and controls

6 lines (4 loc) · 553 Bytes

Basically, Dart is not single-class-single-file like how Java works. Yes, it does support Object Oriented Programming (in kinda different way).

Dart supports variables and functions defined in global space.
You can see this with the main() method which are declared outside any class.

Also, global variables (and static class variables) are lazy evaluated so the value are first defined when you are trying to use them. So your runtime are not going to slow down even if there are a bunch of global variables there are not used.