It is very difficult to learn something like this on your own, as opposed to in an academic environment. You don't have the opportunity to discuss or ask questions to peers. You filled the void for me, Thank you! You have done a wonderful job, please keep doing it.
It's hard to find a RUclipsr that will break everything down "Barney Style", It gives the user so much insight because helps them follow along with things they can refer to. Most beginner tutorials are quick to throw out program Jargin. Great job A += A.
Its been said many times in the comments already, but your tutorials truly are the best I've found for beginners such as myself. Too often, tutorials and instructors simply regurgitate the technical jargon that has become second nature to them over the years. Their familiarity with the language makes it as simple as 2+2, and they fail to remember that was not always the case. Greatly appreciate the way you "dumb it down" for us and explain how everything works in terms that novices such as myself can easily ingest.
I have taken a python course in college and purchased Udemy courses to practice Java automation. Even courses that say they are for beginners skim past details as if it's supposed to be common knowledge, yet you paused and seamlessly answered every question that popped up in my head along the way. Thank you for being thorough, your time really paid off.
Thanks for this explanation. I find it frustrating when people don't explain why something is the way it is. You explain everything, thank you. I would be interested in you going more in depth about the JVM. There's a lot on it and I think you would explain it very well. Anyway, thanks for the video!
I have a test in Java tomorrow and i did not understand anything about static variables and methods. So i googled it and thank god your video poped up you you are a real savior man! Thanks a lot mate you're a really good teacher!
Great video! i am brand new to java, i had a basic class 4 almost 5 years ago my freshmen year of high school and i could not retain any of the information presented to me. it was really hard for me to learn! After i began watching your videos you make it so much clearer and easier to understand. i can not wait to get to your other playlists! thank you so much!
Wow literally the best video to explain static. I watched like dozens of videos to understand this concept but they all just explained about technical stuff not why. Thank you so much!
You have Java tutorial , wow cool , I was looking exactly for your java tutorial and I wished you have Java tutorial , because I followed all your tutorial in CSS, JavaScript , Asp.net. I am so happy to find you in java , you are so cool guy . thank you man , you are the best tutor I've ever seen since I started my program Computer Science at collage, If I wanted to say one things great about your tutorials is these are stars from very basic and continue to get complicate and totally those are complete and another thing is your voice is soft , smooth, fluent and understandable especially for English second languages.Thank you so much
Wow! This is not like "explain a 5 year old"...its the intelligent way of explaining it...im a student in a university...they only said that static ment it didnt have to be called by an objekt!! True but misleading...doesnt give a logical resason as to why!! This was top notch!! I hope he keeps these videos gping! Thanks alot 😊👍
I love these vids! Best vids I found so far and I have been teaching myself with the book and google for the past month. Man I wish i found your videos sooner!
having learned MS BASIC in 1995; my head is still wrapped with my old crutches... taking this slow and I don't care how many times I have to got through this.
had to watch this 6 times and still there are some gray areas but I feel somewhat comfortable moving on finally. But one question I have is that, why not make all the variables and methodes static? So I don't have to worry about static goes with static and instance goes with instance? Thanks.
Hi, so you mentioned that the garbage collector will remove the stuff after it's done... but when does this actually occur? How does it know WHEN to remove the object i.e. newuser1 and its associated variables, etc? Or is this insignificant in grasping the concept of how static works? Also, 2nd question, 4:30, if we did instantiate an object for the Registration class, why couldn't we access the static variable from that object? Isn't it 'always available (as it loiters around in run-time, as you say)? Or is it because of the point you make at the end of the video such that you wouldn't be able to do so? Could you elaborate? Thanks!
Hey great video! I just want to get clear on something...in your constructor where you take a String parameter how come you didnt use this.usernameA= A??? I thought you always do that for your instance variable?
sir may we consider the instance variables as temporary placeholders of a value for its corresponding data type and once its utilisation is accomplished, its value gets flushed out or reset to original as it was created pls correct me if i am wrong 👍👍👍
Congratulation this is a very very good explanation about static variable and method, thank you very much!!!! :) just one more thing, the static variable remains inside the RAM because when static comes out of stack it does not lose its variables ? or static variables and method does not even go into stack ?
I am not sure if it is because something has changed but it gives me an error when I do this: public static void main(String[] args) { Registration.username;
guys only one question if this : public int total2(int n) { return n = Speed + ModelDate; } is the same with this : public int total2() { return Speed + ModelDate; } Why should i use the first one and not just straight the second one? Second Question at program method if i use the first option it requires and int value which is doing nothing and it only prints the total sum anyway System.out.print(BmwM30.total2(10));
Java is the only language I know that has different types of variables like static and instance. I'm a noob so maybe that's the reason I don't know another language that does this. it's a very difficult concept to grasp. static variable to me sounds like an oxymoron. In plain old English, static means it doesn't change and variable means that it changes. This topic is a bit more clear now that I've watched this tutorial. Although it's still hazy on why the hell they would name these things this way?! I wish there was a better name, like persistent variables and persistent methods. "Static variable" is a horrible name. Thank you to EJ Media.
I have a question. You know how you said that static methods should go after static variables. So what about the main method, its static, but in all the previous videos there was no static variables that had been set but the main method was always static. Hope i make sense.
Hafsa saud The main method is a little special - the best way to think of it is that its just the entry point for your program - that is its where everything gets kicked off - a starting point
Correct static methods do not belong to an instance of the class or an object. Static variables and static methods belong to the class. They are not instantiated. Now the static method and variables are put into shared memory. So the other instanced version of the classes or objects can all see that shared memory so that is why they are accessible to anything static. And static always gets loaded first by the JVM ... it will scan for anything with a static keyword. In general though you should use object variables frist but there may be occasions you will use static variables but for the most part you want to use object variables.
I have 3 questions. 1) So is it safe to conclude that by making a static variable, its memory address never change thus it contains the same value and only changes when altered. While objects are created and destroyed after being compiled which leads to my second question that it can't be returned in a static method as it has already been destroyed. And lastly are static methods soley made for static variables only?
MrAirPork1 Exactly static variables will last and instance variables are created and destroyed along with the object. I will say that most developers use instanced variables - there are really only a few reasons why you would use static and that's why I only spent 2 videos talking about static - for the most part you want to use instanced variables
I love this "explain to me like I'm 5" style. You are simply the best at making programming concepts easily understandable to the laymen!
yeah at this point I am still a five year old building my vocabulary and learning how to pronounce syllables.
I didn't see the first quotation mark and I was really confused.
It is very difficult to learn something like this on your own, as opposed to in an academic environment. You don't have the opportunity to discuss or ask questions to peers. You filled the void for me, Thank you! You have done a wonderful job, please keep doing it.
Hehe, void
It's hard to find a RUclipsr that will break everything down "Barney Style", It gives the user so much insight because helps them follow along with things they can refer to. Most beginner tutorials are quick to throw out program Jargin. Great job A += A.
Its been said many times in the comments already, but your tutorials truly are the best I've found for beginners such as myself. Too often, tutorials and instructors simply regurgitate the technical jargon that has become second nature to them over the years. Their familiarity with the language makes it as simple as 2+2, and they fail to remember that was not always the case. Greatly appreciate the way you "dumb it down" for us and explain how everything works in terms that novices such as myself can easily ingest.
When I realised how good this tutorial was, I actually came back to this video just so that I could give it a like :)
I don't know why I've struggled with this concept, but I love how you explained this concept.
I have taken a python course in college and purchased Udemy courses to practice Java automation. Even courses that say they are for beginners skim past details as if it's supposed to be common knowledge, yet you paused and seamlessly answered every question that popped up in my head along the way. Thank you for being thorough, your time really paid off.
Thanks for this explanation. I find it frustrating when people don't explain why something is the way it is. You explain everything, thank you. I would be interested in you going more in depth about the JVM. There's a lot on it and I think you would explain it very well. Anyway, thanks for the video!
I have a test in Java tomorrow and i did not understand anything about static variables and methods.
So i googled it and thank god your video poped up you you are a real savior man!
Thanks a lot mate you're a really good teacher!
Excellent! Crystal clear... I was very confused, that's no longer the case thanks to you EJ Media
Great video! i am brand new to java, i had a basic class 4 almost 5 years ago my freshmen year of high school and i could not retain any of the information presented to me. it was really hard for me to learn! After i began watching your videos you make it so much clearer and easier to understand. i can not wait to get to your other playlists!
thank you so much!
+Greg McDowell Thanks!
hey greggg
Wow literally the best video to explain static. I watched like dozens of videos to understand this concept but they all just explained about technical stuff not why. Thank you so much!
Best explanation about the memory and static! Thanks!! I was puzzled in the last few days, your 15 min saves my few days of brain cells.
... 3 years after I took my java class in college I finally understand static. THANK YOU!!!
Thank you, one of the easiest explanations I have found so far.
You have Java tutorial , wow cool , I was looking exactly for your java tutorial and I wished you have Java tutorial , because I followed all your tutorial in CSS, JavaScript , Asp.net. I am so happy to find you in java , you are so cool guy . thank you man , you are the best tutor I've ever seen since I started my program Computer Science at collage, If I wanted to say one things great about your tutorials is these are stars from very basic and continue to get complicate and totally those are complete and another thing is your voice is soft , smooth, fluent and understandable especially for English second languages.Thank you so much
+Saam Safi Why thank you :)
This explanation is exactly what I've been looking for. Thank you for these tutorials!
Really enjoyed this video the examples were really good and made it easy to understand great job!
I appreciate that you admitted that it was a bit of a struggle to understand this.... Its not as easy as people make it seem at first
Wow! This is not like "explain a 5 year old"...its the intelligent way of explaining it...im a student in a university...they only said that static ment it didnt have to be called by an objekt!! True but misleading...doesnt give a logical resason as to why!! This was top notch!! I hope he keeps these videos gping! Thanks alot 😊👍
Honestly, you made it simple brother
I love these vids! Best vids I found so far and I have been teaching myself with the book and google for the past month. Man I wish i found your videos sooner!
Pretty good explanation :) Probably the best i have watched so far. Great Job! The rock against raging sea analogy was funny though ..lol
Nice explained. Now this information has been loaded in my brain.
thanks for your so clear explanation in such an humorous way.
"They don't got away...It's like a rock" haha i like that sentences lol :D
i try to add some humor lol !
very well explained..... Thank u very much for your effort and time!!
This is a clear && excelent explanation, really nice work putting these concepts together!
having learned MS BASIC in 1995; my head is still wrapped with my old crutches... taking this slow and I don't care how many times I have to got through this.
i really like your explaination, i have watch several videos but they aren''t a match to your's.keep it up and thanks a lot
A very useful and well explained tutorial
Super clearly explained, thanks!
"it's like a cliff on the edge of the sea-it never goes away" hahahaha
Great Vid! Simple explaination. Keep going.
Great video, just wonder if you can paste the codes as well so that we can practise right away.
had to watch this 6 times and still there are some gray areas but I feel somewhat comfortable moving on finally.
But one question I have is that, why not make all the variables and methodes static? So I don't have to worry about static goes with static and instance goes with instance?
Thanks.
Hi, so you mentioned that the garbage collector will remove the stuff after it's done... but when does this actually occur? How does it know WHEN to remove the object i.e. newuser1 and its associated variables, etc? Or is this insignificant in grasping the concept of how static works?
Also, 2nd question, 4:30, if we did instantiate an object for the Registration class, why couldn't we access the static variable from that object? Isn't it 'always available (as it loiters around in run-time, as you say)? Or is it because of the point you make at the end of the video such that you wouldn't be able to do so? Could you elaborate? Thanks!
you are the best man. i love your explanation. subscibed
Great video and explanation. Thanks sir!
thank you. you make this this topic easy to understand
very useful video, Thank you so much
Thank you very very much for good tutorial
it is such a great tutorial video !! thanks a lot!
Hey great video! I just want to get clear on something...in your constructor where you take a String parameter how come you didnt use this.usernameA= A??? I thought you always do that for your instance variable?
Really good explanation
Thank you! This was super helpful
sir
may we consider the instance variables as temporary placeholders of a value for its corresponding data type and once its utilisation is accomplished, its value gets flushed out or reset to original as it was created
pls correct me if i am wrong
👍👍👍
Thanks man, great explanation
Congratulation this is a very very good explanation about static variable and method, thank you very much!!!! :)
just one more thing, the static variable remains inside the RAM because when static comes out of stack it does not lose its variables ? or static variables and method does not even go into stack ?
Holy shit! This is the fastest I have seen you typing so far :D
I used to record in the light - now I record in the dark lol
How come the constructor can access the static variables, even though it doesn't specify static?
Best explanation ever thanks!!
very simple and great tutorial :)
Subbed! Amazing
your methode return type is int and you want to return a String value of usernameA what kind of programming is that?
7:10 outch, This is only a reference variable in the Stack memory and not an Object, object gets loaded to the heap with "new" syntax :O
very useful
I am not sure if it is because something has changed but it gives me an error when I do this:
public static void main(String[] args) {
Registration.username;
Sir,
What is the mean of Return Value ?
guys only one question if this : public int total2(int n) {
return n = Speed + ModelDate;
}
is the same with this :
public int total2() {
return Speed + ModelDate;
}
Why should i use the first one and not just straight the second one?
Second Question at program method if i use the first option
it requires and int value which is doing nothing and it only prints the total sum anyway
System.out.print(BmwM30.total2(10));
OMFG I've been enlightened :O
Java is the only language I know that has different types of variables like static and instance. I'm a noob so maybe that's the reason I don't know another language that does this. it's a very difficult concept to grasp. static variable to me sounds like an oxymoron. In plain old English, static means it doesn't change and variable means that it changes. This topic is a bit more clear now that I've watched this tutorial. Although it's still hazy on why the hell they would name these things this way?! I wish there was a better name, like persistent variables and persistent methods. "Static variable" is a horrible name. Thank you to EJ Media.
so a static method means that it is always there?
what if i want to find the list of names in my database ? how do i do that ?
I have a question. You know how you said that static methods should go after static variables. So what about the main method, its static, but in all the previous videos there was no static variables that had been set but the main method was always static. Hope i make sense.
Hafsa saud The main method is a little special - the best way to think of it is that its just the entry point for your program - that is its where everything gets kicked off - a starting point
Not satisfied... can u give some valid reason
I don't kind that "the best way to think" we want a deep explanation bout that static main method
Thank you!
Subs first, watching later...!!
Do static variables survive the heat death of the universe? I can't see a reason why not...
Anyone watching these Tutorials live near Boise? If so we should link up I could use help understanding how some of this works if you got it down.
Thank you.
Thank you
THANK YOU!!
ty
So the method belongs to the class itself and can call the method without first creating a class instance.
Correct static methods do not belong to an instance of the class or an object. Static variables and static methods belong to the class. They are not instantiated. Now the static method and variables are put into shared memory. So the other instanced version of the classes or objects can all see that shared memory so that is why they are accessible to anything static. And static always gets loaded first by the JVM ... it will scan for anything with a static keyword. In general though you should use object variables frist but there may be occasions you will use static variables but for the most part you want to use object variables.
So unless you have a real good reason always try to use object variables and methods first. I just wanted to explain what static was in this video.
A static variable or a static method can be called by an object. But in the video 4:41 it denies the fact.
And they all happily lived ever after...
I have 3 questions.
1) So is it safe to conclude that by making a static variable, its memory address never change thus it contains the same value and only changes when altered.
While objects are created and destroyed after being compiled which leads to my second question that it can't be returned in a static method as it has already been destroyed.
And lastly are static methods soley made for static variables only?
MrAirPork1 Exactly static variables will last and instance variables are created and destroyed along with the object. I will say that most developers use instanced variables - there are really only a few reasons why you would use static and that's why I only spent 2 videos talking about static - for the most part you want to use instanced variables
EJ Media Thanks a lot for answering my questions. Will continue to go through your tutorials
Thank you!