If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
Hi Alex! I'm prepping for my Java certification as a high school student and have been slowly burning through all your videos this summer. I can't thank you enough for all the free, high quality tutorials you've given all of us and hope you know that what you're doing is really helping us kiddos get into computer science.
I've binge-watched all your videos on java basics and intermediate java and I practiced at the same time and I must say it's the first time I have all these cleared up inside my head. Thank you for everything you did for us! You saved a lot of us :)
hey alex just completed your intermediate coarse ....thanks a lot ,u are doing a wonderful job and good karma at appx. our age keep up the work and stay blessed
finally my biggest question regarding java clearing today , i even felt problem in Android with inner classes like when we create adapters,,their are lots of inner classes in it,, ,Thanks mate love from Pakistan
Dude said “I know this looks comfusing”...after i wasted so many hours of my life trying to figure out my Java trainer’s stupid example with icecream trucks.🤦🏻♂️Man you make it so easy to understand...
Learning your videos have been fun kind of and truly engaging . Would you please organise the Java tutorials into a numbered playlist ? This will help us follow u sequentially! Thank u 🙏🏾
Good Explanation. Please add this to your next video ===> Types of Inner Class:- i) Normal Class or Regular Inner Class ii) Method Local Inner Class iii) Anonymous Inner Class iv) Static Inner Class
I thought nested classes were an alternative to using "extends" on your subclasses. I guess that's not really the case. Thank you for clearing my mind.
Would it make sense to structure your code using Inner Class if it extends Outer Class? For example, if the outer class is vehicle; then you add inner classes for car, van, and motorcycle? Thanks for running the best Java vids I've found!
I think it’s not exactly the case but, for instance, you can have the Car class with the inner class Engine. Engine is a complex structure which has it’s properties and functionality and every car has it. Hope it makes sense
I have commented on ur tictactoe video about "cannot find c" from containsAll()..i use bluej and it doesn't have that feature to import ' bad boy' like that
Thanks that was really helpful! Why do inner classes exist at all though? Couldn't you program everything computable without them? Is it to help you achieve the single responsibility principle?
In Java, both next() and nextLine() are methods of the Scanner class that are used to read user input from the console. next() method reads the next token (sequence of characters separated by whitespace) and returns it as a string. It stops reading when it encounters whitespace (space, tab, or newline). For example, if the user enters "Hello World", next() will only return "Hello". On the other hand, nextLine() reads the entire line of input entered by the user, including any spaces or tabs. It stops reading only when it encounters a newline character, which is created when the user presses the Enter key. For example, if the user enters "Hello World", nextLine() will return the entire string "Hello World". Hope this clears it up!
I know this is an old video but hopefully you still read comments I was just wondering I tried in my IDE and I was able to do Outside o = new Outside(); Inside = o.new Inside(); Is it any different from doing it like you at 1:43?
@Joon Park I mistyped it, if you look closely I didn't assign a variable name to the type Inside but if you do then it works. Inside o = o.new Inside();
Import is a keyword that imports a class from different package, so the class you are working in can directly access it`s name. For example Scanner class is located in java.util, and if you wanted to create a Scanner object, you would have to do it like this: java.util.Scanner scanner = new java.util.Scanner(); But if you import it with: import java.util.Scanner, you can create a Scanner object like this: Scanner scanner = new Scanner() extend is part of the inheritance. When a class extends another class, it inherits all of its methods and variables.
@@kumat7 You would use inheritance when it makes sense for multiple classes to share the same code. So instead of copy&pasting the code in each class, you would have 1 base parent class that has the code the classes would share, and then the classes would extend it. Inheritance means IS-A relationship. Example: Dog IS-A animal, so it makes sense for dog to extend Animal. Knife IS-A Weapon, so it would make sense for Knife to extend Weapon. For example imagine you are doing a simple game with animals and you would want to code animals. What does every animal share in the game? Every animal would have position, speed, health, strength, defense... methods: attack(), move(), die()...... Code example: public class Animal { private int x, y; // coordinates for position private int speed; private int health; private int strength; private int defense; public Animal() { } // constructor public void attack() { // code for attack } public void move() { // code for movement } public void die() { // code that checks if health is zero and then deletes the animal if it is } } Then you would have for example Dog class that extends Animal class: public class Dog extends Animal { // some extra attributes and methods that only dog has } So now the Dog class has all the attributes and methods of Animal and also some own attributes and methods. You could then also do other animals like Cat. Hope this makes it clear.
You would first have to instantiate another object from the Outside class, as opposed to instantiating it from the Inside class. I'm not certain but I believe there's another (simpler) way to do it as well.
it really sucks to live in a third world country . not trying to bitch about it or anything but it got to me ... one of the simple things i want is this java course but guess what i cant afford it . lol its funny to think that the price is one of my parents salary . the f ing corrupted countries we live in ey . and thanks Alex for the valuable free content ... if you reading this and you are fortunate enough please acknowledge that . hope you all a nice day.
If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
The best Java UA-camr out there
Thats true
Yes, I literally see his videos just for fun, they are amazing
And the cutest.
I couldn't say it better
Hi Alex! I'm prepping for my Java certification as a high school student and have been slowly burning through all your videos this summer. I can't thank you enough for all the free, high quality tutorials you've given all of us and hope you know that what you're doing is really helping us kiddos get into computer science.
how'd it go :)
I'm in uni n understanding from him too like
I've binge-watched all your videos on java basics and intermediate java and I practiced at the same time and I must say it's the first time I have all these cleared up inside my head. Thank you for everything you did for us! You saved a lot of us :)
I really admire how you can make Java easy to understand and not getting complicated. Thank you!!
Literally say, "Yes let's go baby!" when I search for a java concept and this guy's made a video on it
U are the best java teacher in the world
short and to the point
thank you
hey alex just completed your intermediate coarse ....thanks a lot ,u are doing a wonderful job and good karma at appx. our age
keep up the work and stay blessed
finally my biggest question regarding java clearing today , i even felt problem in Android with inner classes like when we create adapters,,their are lots of inner classes in it,, ,Thanks mate love from Pakistan
Great example and straight explanation bro! Weird, but interesting. Now I'm wondering where to take advantage of it. 🤔
Dude said “I know this looks comfusing”...after i wasted so many hours of my life trying to figure out my Java trainer’s stupid example with icecream trucks.🤦🏻♂️Man you make it so easy to understand...
Learning your videos have been fun kind of and truly engaging . Would you please organise the Java tutorials into a numbered playlist ? This will help us follow u sequentially! Thank u 🙏🏾
Imagine the project name, but outta context.
This is great, really helpful to understand what is inner class. Thanks for sharing this
Good Explanation. Please add this to your next video ===> Types of Inner Class:- i) Normal Class or Regular Inner Class
ii) Method Local Inner Class iii) Anonymous Inner Class iv) Static Inner Class
Thanks Alex..you are making Java simple to learn from me..
If you haven’t already, can you make a video on Overriding methods during inheritance?
Can you make a video about Optional Class?
HIIII! Your vids help me soo much
Loved it✌🏻
U haven't even watched it bruh the video is 4 mins long and u commented this after a minute of it being released
@@zeradris Yes 😂
all makes sense now
I thought nested classes were an alternative to using "extends" on your subclasses. I guess that's not really the case. Thank you for clearing my mind.
Hi Alex, would you happen to have tutorial about Java wildcard?
thank you so much for these videos
Can you give me an example when this class inside a class needed in a program.
Would it make sense to structure your code using Inner Class if it extends Outer Class? For example, if the outer class is vehicle; then you add inner classes for car, van, and motorcycle? Thanks for running the best Java vids I've found!
I think it’s not exactly the case but, for instance, you can have the Car class with the inner class Engine. Engine is a complex structure which has it’s properties and functionality and every car has it. Hope it makes sense
Can you teach how to create temporary objects in java
You are really good!
Brother Can you please make a video on wrapping a java project to exe file.
Do tutorials on stuff like algs and data structures too!. im sure many people will like it too.
And no one does design patterns
can u make a video about windowBuilder i cant install it on eclipse
bro u can use netbeans
good video, good explanation.
Thank you!
yas
I love you lee
I have commented on ur tictactoe video about "cannot find c" from containsAll()..i use bluej and it doesn't have that feature to import ' bad boy' like that
Thank you :)
the link for your course isnt working for me, is it geolocked?
can it be declared as
Object i = new Outside().new Inside();
Thanks that was really helpful! Why do inner classes exist at all though? Couldn't you program everything computable without them? Is it to help you achieve the single responsibility principle?
Linked lists maybe
Alex can you please make a video explaining the difference between next() vs nextLine() ? PLEASE!
In Java, both next() and nextLine() are methods of the Scanner class that are used to read user input from the console.
next() method reads the next token (sequence of characters separated by whitespace) and returns it as a string. It stops reading when it encounters whitespace (space, tab, or newline). For example, if the user enters "Hello World", next() will only return "Hello".
On the other hand, nextLine() reads the entire line of input entered by the user, including any spaces or tabs. It stops reading only when it encounters a newline character, which is created when the user presses the Enter key. For example, if the user enters "Hello World", nextLine() will return the entire string "Hello World". Hope this clears it up!
@@Nino-xe3oj Thank you bro.
I know this is an old video but hopefully you still read comments I was just wondering I tried in my IDE and I was able to do
Outside o = new Outside();
Inside = o.new Inside();
Is it any different from doing it like you at 1:43?
@Joon Park I mistyped it, if you look closely I didn't assign a variable name to the type Inside but if you do then it works.
Inside o = o.new Inside();
thank you
Can you make a video on object casting (upcasting) please! Thanks for the great content. ☕☕☕
Bro how many programming languages do you know and are you a full stack developer?? Please reply me. I will be grateful if you reply me😀😀
Can you tell me the difference between importing and extending a class in java
I believe talks about extending classes in this video:
ua-cam.com/video/zbVAU7lK25Q/v-deo.html
Import is a keyword that imports a class from different package, so the class you are working in can directly access it`s name. For example Scanner class is located in java.util, and if you wanted to create a Scanner object, you would have to do it like this:
java.util.Scanner scanner = new java.util.Scanner();
But if you import it with: import java.util.Scanner, you can create a Scanner object like this:
Scanner scanner = new Scanner()
extend is part of the inheritance. When a class extends another class, it inherits all of its methods and variables.
My main question is when to use extends to inherit a class and then using it and when to use the class directly by making its object.
@@kumat7 You would use inheritance when it makes sense for multiple classes to share the same code. So instead of copy&pasting the code in each class, you would have 1 base parent class that has the code the classes would share, and then the classes would extend it. Inheritance means IS-A relationship. Example: Dog IS-A animal, so it makes sense for dog to extend Animal. Knife IS-A Weapon, so it would make sense for Knife to extend Weapon. For example imagine you are doing a simple game with animals and you would want to code animals. What does every animal share in the game? Every animal would have position, speed, health, strength, defense... methods: attack(), move(), die()......
Code example:
public class Animal {
private int x, y; // coordinates for position
private int speed;
private int health;
private int strength;
private int defense;
public Animal() { } // constructor
public void attack() {
// code for attack
}
public void move() {
// code for movement
}
public void die() {
// code that checks if health is zero and then deletes the animal if it is
}
}
Then you would have for example Dog class that extends Animal class:
public class Dog extends Animal {
// some extra attributes and methods that only dog has
}
So now the Dog class has all the attributes and methods of Animal and also some own attributes and methods. You could then also do other animals like Cat.
Hope this makes it clear.
@@ariton2990 Thanks for clearing my doubts
if you were to do it the way shown at 3:26 how would you print a?
You would first have to instantiate another object from the Outside class, as opposed to instantiating it from the Inside class. I'm not certain but I believe there's another (simpler) way to do it as well.
could you please teach Java at my university? you´d save many lives
I had a eh? Moment then I realised that the innerclass was static 😅 I think an example of the outer scope world of been nice
oh my god that is so freaking true
JavaFX tutorial?? pls
Bro i really appreciate your effort but that background musics are distracting plz use instrumental music as a background
We need composition plz 😢
do anonymous classes next
it really sucks to live in a third world country . not trying to bitch about it or anything but it got to me ...
one of the simple things i want is this java course but guess what i cant afford it . lol its funny to think that the price is one of my parents salary .
the f ing corrupted countries we live in ey .
and thanks Alex for the valuable free content ...
if you reading this and you are fortunate enough please acknowledge that .
hope you all a nice day.
i dont know what you will think but i wanna say that you are very cute.😶😶...
My least fav chapt tbh hope it doesn't come on the exam 🧍🏻♀️
Thank you!