Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main(){
- User userone = User('rajath', 69);
- print(userone.age);
- print(userone.username);
- userone.login();
- }
- class User{
- String username;
- int age;
- User(String x, int z){ //doest need to be username and age, can be named anything like u and a
- this.username = x;
- this.age = z;
- }
- void login(){
- print('User has logged in');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement