Java Tutorial For Beginners 21 - 'static' keyword in Java

preview_player
Показать описание
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!

java static meaning
static method in java
define static java
difference between static and nonstatic methods in java
use of static in java
when to use static methods in java
how to call static method in java
difference between static method and non static method in java
accessing non static from static method
Рекомендации по теме
Комментарии
Автор

I guess the reason why some people didn't understand clearly is because "hello" was used as an instance with class name "Hello". Something like.. Fruit for class name and apple for instance name would have been better. Thanks for the vid it helped a lot.

Eviscerate
Автор

Finally, I understand why it makes sense..!!!... whenever we declare a variable or method static, we can access it through the class, if it's non-static then we can access it through the instance/object of the class, not the class itself. Isn't it right?

abdullahansari
Автор

I think you didnt explain good enough things in this video....
I Saw it 4 times & didnt understand

roygertel
Автор

To summarize this whole video:
a static method is one that can be invoked through its class name.

BTW, He explained it well. The only problem is that he used "Hello" for the class's name and "hello" for the variables' names which is the main reason why many of you here didn't understand.

zcsqwrf
Автор

Dislikes are from people that dont know english and are sad that cannot learn it

szyszak
Автор

Uppercase "H" "Hello" and Lower case "h" "hello" at 3:34. That should help out clear things.

rhythmlama
Автор

I think we use static for memory management. If i call a static method by instance of a class it takes new memory for creating that instance. But u can call that static method with class name, so why i'm going to take some memory for access static method. That's it.

arnabmajumder
Автор

Confusing and replace your smoke detector batteries!

Maxintosh
Автор

Excellent explanation of Static. Very easy to understand.Keep up the good work.

servoman
Автор

For those who know Ruby. The static refers to class instance and without static refers to method instance

carlosc
Автор

That smoke detector in the background has been chirping for the last 4 or 5 videos :P

ArmandoDiazMiami
Автор

i got understood this tutorial to some far extent.You delivered this WELL.But, i have no clarity that "why we are using/placing this static keyword in header of main method" (or) "why we should use this static keyword in main method header?!".IS IT THAT NECESSARY? IF SO, reply me and mention its

vikramreddy
Автор

Hi.. when should we use method using static n when is it better not to ? Can u explain with an example?

anuvarghese
Автор

7:19 - 7:39 is everything you need to know, the video is kind of messy(Helloohhlleoeoolllo)... and how can you record with the friggin beeping through so many episodes???

gamefoot
Автор

I think it would be better if the last print line can be changed from
 into


So that people know that change of static member in one instance works for all other instances of the same class.

xiaoyizhang
Автор

7:20 - 7:44 basically summarizes the whole thing

JustMorePerson
Автор

im pretty tired and this just confused the crap out of me lol.

xxphuzyxx
Автор

can you tell me ... how can we print a string by DoSomething() function... I mean you didn't print " hi youtube " ... you only print the value of integer ... Can you tell me ? How can we " hi youtube " in a similar way

RakeshVerma-tvwi
Автор

Thank you for this. This cleared things up for me.

LastRellik
Автор

You only were getting confused. After assigning a value to hello1.age as 50, you should print both hello1.age and hello.age. The output for the hello.age will also get changed to 50 as age is a static variable, depends only upon class not on the instance and it changed for every instance after assigning it any value in any instance.

himanshujain