Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wrappers

 
Chetan Dodiya
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this q is from ExamLab



OUTPUT IS
AGAADGBDAF

why in this program wrapper Byte is widen to Number
because Wrapper type cant widen...
so why this program works fine???
 
Markus Klein
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Widening of reference variable depends on inheritance(so, Integer cannot be widened to Long. But, Integer widened to Number)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic