Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Casting

 
akila sekaran
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


what will happen in this ?
 
Panagiotis Kalogeropoulos
Rancher
Posts: 99
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried it yourself? What do you think will happen and why?
 
akila sekaran
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class cast exception ;-)
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
akila sekaran wrote:Class cast exception ;-)


So, what are you casting into what? Please take a close look at your code (by the way, it also contains a compilation error, which I believe might be a typo during pasting the code).

Hint : All Managers are Employees - but can you cast an Employee to Manager?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic