Inner Class Java Tutorial - Creating and Using Inner Classes

preview_player
Показать описание

Inner Classes can be a confusing topic when you're a Java beginner (or maybe even a bit more advanced...)

But creating an inner class in Java is way easier than it seems, and whether you're a Java beginner or further along in your Java career, this video will have you creating your own inner class in Java in no time!

We'll talk about 3 different types of Java Inner Classes, how you can create them, and how you can use them.

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:

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

Watching this again I just realized I made a mistake with the editing in part of the intro, where I had my face in the corner and a blank rest of the screen. Oh well, hope you all can forgive such a grievous mistake >_>

CodingWithJohn
Автор

Have been programming in java for years but somehow im hooked on all ur videos lol. Think its learning how to explain concepts in an easy way, ur so darn good at that. Also, had no idea you could create classes in a method! I keep learning

samuvisser
Автор

Poland Computer Science student says thank you !!
The way you teach is absolutely awesome!

johntravolta
Автор

This mans gonna get me through university

dilln
Автор

You explain things by telling whats the problem or need of the topic that you're going to explain by giving a example case, It helps so much when i know where can be the concept that i am learning be used instead just watching plain theory tutorials which don't tell the cases where it can be used or whats the problem that may arise if we do things other way.

vikastiwari
Автор

I've written a lot of different inner classes, but I still learned some things from the video. Kudos to you John!

jamesdrinkard
Автор

>Has never seen this being used
>Still makes a video about it

Big hustler energy!

dragosudrea
Автор

We use theese to program our frc robot, we have a constants class then inside od the constants class there are inner classes for each subsystem. It its really helpful when you want to keep everything divided and prevent yourself from mixing things up.

Theinatoriinator
Автор

I learn something new with you every time I revisit familiar subjects. You are great!

KingSardius
Автор

You just made me interstand this concept after days of frustration. Thanks a lot!

aprendeguitarraclasica
Автор

Spent the _whole_ day yesterday reading a book by C. Horstmann, trying to understand the syntax of outer/inner class, trying to understand how the _"this"_ keyword figures into this whole thing, and by the end of the day, I was more confused than I was at the start. I watched this video today and just 8 minutes into it, I understood nearly everything.

CharlesWhitford
Автор

This Video just saved me in my Exam, thank you for the great Video

qwerrewq
Автор

The best tutorial. I'm so glad to stumble upon this video. Concise. discusses the key important points of inner classes and examples. Very easy to understand how you speak. Well done.

jlwonders
Автор

Leaving a comment for the YouTube algorithm because you’re super helpful 😁

_Anna_Nass_
Автор

John your style of teaching is simply fabulous. you can make learn a person easily. thanks John.

faheemsyed
Автор

I've had already read the documentation and understood how ir works but decided to see a video about it, because I was fatigue. And have to admit, your content is amazing. You explained this very fast and well. Congrats! Just sub to the channel. It'll help a lot for sure. Tks for the video.

jgabrielmiranda
Автор

So innerclass are just normal classes in different locations, which you can access with Outername.Innername or inside the method when you create an object there. Got it. Thank you, this really blew my mind.

DaxterSnickers
Автор

That was just GREAT!
You didn`t waste my time!

HeisenbergHK
Автор

I've recently learned how to use an anonymous inner class to instantiate something like a HashMap and put values straight away. It would be good to learn more about anonymous inner classes and their uses.

Enanram
Автор

Appreciate this explanation about static inner classes, for some reason I keep forgetting what makes it static. Great vid!

fc