Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyGenericClass<TKey, TValue> {
- Map<TKey, TValue> map;
- MyGenericClass() {
- this.map = new Map<TKey, TValue>();
- }
- myAdd(TKey key, TKey/*TValue*/ value) {
- this.map[key] = value; // Warning. Great!
- return this;
- }
- myGet(TKey key) => this.map[key];
- }
- main() {
- var test = new MyGenericClass<int, int>();
- test.myAdd(10, 20);
- print('Result is not ${test.myGet(10) - 1}');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement