Upcasting and Downcasting in Java - Full Tutorial

preview_player
Показать описание
Learn about Upcasting and Downcasting in Java! Full tutorial with concrete examples.

In Java, upcasting and downcasting are used along with method overriding to do some really cool things. But what exactly is upcasting, what is downcasting, and how do you use them in your Java programs?
When can you upcast, and when can you downcast? What do you need to know to use upcasting and dowcasting safely? We'll talk about all of that and more beginner-friendly Java tutorial video.

Learn or improve your Java by watching it being coded live!

Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.

Let me know what else you'd like to see!

Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.

📕 THE best book to learn Java, Effective Java by Joshua Bloch

📕 One of my favorite programming books, Clean Code by Robert Martin

🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial

🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)

📹Phone I use for recording:

🎙️Microphone I use (classy, I know):

Donate with PayPal (Thank you so much!)

☕Complete Java course:

Рекомендации по теме
Комментарии
Автор

the "meow" at 5:05 was the best part of the video, thanks john

arturmelo
Автор

I have my java exam in university in 15 days and I was so stressed about it but watching your videos made it so easy to understand Java. Lots of love to you from Stockholm. :)

callmesej
Автор

I've been learning java for a few years and NEVER had such a good explanation about this. Thank you John you're saving my degree.

Christian-ryol
Автор

HANDS DOWN the absolute best channel I've found regarding Java tutorials and explanations. Thank you John!

josephthecreator
Автор

First time YouTube recommendation worked for me. Came across you video's and haven't stopped watching ever since. Thank you so much, your explanation are unbelievably good and easy to understand.

LuckyMakhado
Автор

I've been searching for a specific answer for over and hour, came over your video and got the answer in less than 5 minute, thank you very much!

MishaKoroliov
Автор

What a great video! I am reading a book on Java and I didn't understand downcasting, upcasting, instanceof at all until I watched this video. This explanation is so much better than the explanation in my book.

smrtfasizmu
Автор

Lots of people know Java very well, but only a handful of people know how to pass the knowledge on. Congrats for being one of them!!!

Автор

this video is life saver, nobody on internet explained it this way, whenever i read an article or watch a video about up/down casting they just tell you the syntax which is pretty easy, but i never understood the concept of it, why should i use up/down casting? since i already can call each method from it's own object? but finally i found this video although i'm coming from C# background and i could still understand everything he said. Thumbs up for this man!

emreibrahim
Автор

This was so helpful! My professor just randomly assumed that we know what casting is and I didn't quite get the hang of it til this video! Thanks!!

dominiqueradtke
Автор

What the f... those are the best explanations I've heard so far. That sums up 3 hours of Uni lecture in 10 minutes!

robert
Автор

I’m a relatively new C# programmer and even though this video was explained in Java it made PERFECT sense to me. Great job!

redbladex
Автор

OMG ! this video made my day, I have been searching for upcast and downcast for a day, none cleared me, but the example in your video told why we have to use this upcast and downcast, caught my mind, thankyou so much, you are an amazing explainer. and I subscribed your channel, keep posting amazing contents.

sabari
Автор

Love your videos John, I am using them to supplement the course materials in my intermediate java college course. They are extremely helpful for a 52 year old.

BGP_
Автор

Excellent, clear video. Thanks. 😊

Also, I liked the characterisation you gave Java… it trusted us “but we betrayed its trust by throwing-in a cat” 😂

findlestick
Автор

This video is a life saver for upcasting and downcasting. Thank you!!

aileenchan
Автор

I was taking this online java course and in it they threw in upcasting and down casting while teaching polymorphism without explaining what this casting is. This was such a great explanation!

evangrove
Автор

i havemore than a couple of videos to understand casting, but i found yours so clear, thanks jo

natnaelhaftu
Автор

Great video, loving your channel so far! I want to add for new learners: One of the most important uses of upcasting is when you have an ArrayList, List, LinkedList, etc, and you can make it of type Animal while adding all types of animals like Cats, Dogs and whatever

renzotorr
Автор

Thank you so much for explaining these concepts. I'm learning java. I'm new to to your channnel. No one can explain concepts in more simple way other than you. Keep uploading new tutorials.

chiranjibdash