Advertisement
Guest User

Untitled

a guest
May 21st, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. class Bye {
  2. int a = 1;
  3. }
  4.  
  5. class Say extends Bye {
  6. int a = 2;
  7. }
  8.  
  9. void printBye<T extends Say>(T b) {
  10. print(b); // prints Instance of Bye
  11. print("a: ${b.a}"); // not an error anymore
  12. }
  13.  
  14. void main() {
  15. printBye(Say());
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement