Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. //How to use enum
  2. void main () {
  3.  
  4. Car myCar = Car(carStyle: CarType.convertable);
  5.  
  6. print(myCar);
  7.  
  8. }
  9. class Car {
  10.  
  11.  
  12. // int carStyle;
  13. CarType carStyle;
  14.  
  15. Car({this.carStyle});
  16. }
  17.  
  18. enum CarType {
  19. probox,
  20. hatchBack,
  21. convertable
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement