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

Downcasting in Java.

 
Shankara Sharma
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we do down casting in Java? Please provide an example.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The child type should be specified in brackets
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shankara Sharma wrote:How can we do down casting in Java? Please provide an example.


In the future, please ShowSomeEffort(⇐click) and SearchFirst.(⇐click)

java downcasting example
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic