rajath_pai

LearningDart

Jul 29th, 2021
687
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void main(){
  2.   User userone = User('rajath', 69);
  3.   print(userone.age);
  4.   print(userone.username);
  5.   userone.login();
  6. }
  7.  
  8. class User{
  9.   String username;
  10.   int age;
  11.  
  12.   User(String x, int z){ //doest need to be username and age, can be named anything like u and a
  13.     this.username = x;
  14.     this.age = z;
  15.   }
  16.  
  17.   void login(){
  18.     print('User has logged in');
  19.   }
  20. }
RAW Paste Data