Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main() {
- var num=Generic<int>(123);
- num.write();
- var num2=Generic<String>("Hitesh");
- num2.write();
- }
- class Generic<T>
- {
- T number;
- Generic(this.number);
- void write()
- {
- print("$number");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement