Upcasting vs Downcasting in Java With Program Example

Veröffentlicht am: 15 Mai 2018
auf dem Kanal: Simple Snippets
65,632
1.4k

Support Simple Snippets by Donations -
Google Pay UPI ID - tanmaysakpal11@okicici
PayPal - paypal.me/tanmaysakpal11
--------------------------------------------------------------------------------------------- In this java programming video tutorial we will study and understand the concept of Upcasting and Downcasting. We will also understand the difference between upcasting and downcasting in Java.
Upcasting in Java -
Upcasting is casting a subtype to a supertype, upward to the inheritance tree. Upcasting happens automatically and we don’t have to explicitly do anything.

Downcasting in Java -
When Subclass type refers to the object of Parent class, it is known as downcasting. If we perform it directly, compiler gives Compilation error. If you perform it by typecasting, ClassCastException is thrown at runtime.

For more details checkout this website link - https://simplesnippets.tech/upcasting...

Core Java Programming Playlist -    • Java Programming - Introduction | History ...  

Download the FREE Java Programming Android App from Google Playstore - https://play.google.com/store/apps/de...

Simple Snippets Official Website -
https://simplesnippets.tech/
Simple Snippets on Facebook -
  / simplesnippets  
Simple Snippets on Instagram -
  / simplesnippets  
Simple Snippets on Twitter -
  / simplesnippet  
Simple Snippets Google Plus Page -
https://plus.google.com/+SimpleSnippets
Simple Snippets email ID -
simplesnippetsinfo@gmail.com

For More Technology News, Latest Updates and Blog articles visit our Official Website - https://simplesnippets.tech/


Auf dieser Seite können Sie das Online-Video Upcasting vs Downcasting in Java With Program Example mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Simple Snippets 15 Mai 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 65,632 Mal angesehen und es wurde von 1.4 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!