Static in Java Tutorial #75

  Рет қаралды 258,177

Alex Lee

Alex Lee

Күн бұрын

$1,000 OFF ANY Springboard Tech Bootcamps with my code ALEXLEE. See if you qualify for the JOB GUARANTEE! 👉 bit.ly/3HX970h
The static keyword in java lets you use global variables without creating the object. Learn how to use static easily in this video.
Learn java in just 13 minutes: • Learn Java in 14 Minut...
The java static keyword can be tricky at first... But SURELY you'll get it :) If you followed along, congrats! You learned by-doing!
I hope you enjoyed this tutorial about the static keyword in java! I like to have a nice mix of java tutorials and actual projects for you all :)
Was this able to help you learn static in java? -
Full Java Tutorial For Beginners Playlist: • Full Java Course by Al...
Free Tips: bit.ly/3U6HXcb
Disclosure: The Springboard link provided is linked to my affiliate account & supports the channel.
~
Alex Lee

Пікірлер: 508
@alexlorenlee
@alexlorenlee 11 ай бұрын
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
@MphatsooxylMnyenyembe
@MphatsooxylMnyenyembe 8 ай бұрын
add me please
@Claymore4Breakfast
@Claymore4Breakfast 5 жыл бұрын
You’re literally the best tutorial person. You don’t assume that people know things, you explain even the basic things and i love that. Thanks so much!
@alejandroguerenagonzalez2079
@alejandroguerenagonzalez2079 4 жыл бұрын
Claymore4Breakfast not to mention, he is really well spoken. Never confusing and never used fillers
@andreassjo7268
@andreassjo7268 4 жыл бұрын
Totally agree! I'm going through a java programming class right now, and since the books we use are like "Hey! you already know everything about Java? Then read me!" I just simply read the tasks, then go to Alex channel to accually understand what the heck i'm supposed to do
@Smile-wd6rz
@Smile-wd6rz 4 жыл бұрын
@@andreassjo7268 I am doing the same thing, I'm doing a video game course and the guy said that it's better to learn the bulk of programming first then to start working on an engine. But he explains so quickly and sometimes he just comes with a new thing and says: Just copy it, like no man, I wanna know what it means so it can be in my head forever.
@spiceydice6968
@spiceydice6968 3 жыл бұрын
Yeah, he even explains the origins of "static" and the other alternative to static. Truly an amazing person.
@porkfreegaming5278
@porkfreegaming5278 3 жыл бұрын
I agree, this guy is awesome
@ghostropes
@ghostropes 5 жыл бұрын
I'm so happy I found this channel, now I can binge and feel like I'm learning something XD
@lordmzte724
@lordmzte724 5 жыл бұрын
well "static" makes sense, because it does mean standing still: its in a fixed position in memory and its impossible for it to be instanced like with non static fields
@hyphen8d725
@hyphen8d725 4 жыл бұрын
What do you mean by instanced?
@TheHelghastkilla
@TheHelghastkilla 4 жыл бұрын
@@hyphen8d725 to be used, so like lets say you have a class and you instanced it, that meant you did the usual Class a = new Class();
@williamtrillion992
@williamtrillion992 3 жыл бұрын
@@hyphen8d725 instance means it’s well... an instance of maybe a method, or variable. It can change based on the new object you created. We could have a static variable that all car objects have 4 wheels. An instance variable could be the color or model of the car.
@ahmedtlm9488
@ahmedtlm9488 3 жыл бұрын
It means ! Let's say you have a class : class Car { static int a=0;. } So if you create 2 object of this class : Car c1 = new Car(); Car c1 = new Car(); The two object have a variable a = 3 right ?!!; Let's do this : c1.a= 1; // that's mean the variable a in the object 1 changed to value 3 ! Yes ! But since we put static keyword to the variable a another thing happen ! all variable a changed to value 3 ! So if we do this : System.out.println (c2.a)// we will see : 3 And also if we create a new object ; Car c3 = new Car() c3.a // by default equal 3! That's mean not only the variable on object 1 changed!!! But the variable in the class changed also and that's what really mean static keyword I hope you all understand
@ЮраЯньо-е1л
@ЮраЯньо-е1л 3 жыл бұрын
@@ahmedtlm9488 "The two object have a variable a = 3 right ?!!;" u maybe wanted to say a = 0, cuz a was intialised with zero here "static int a=0;"
@adultishgambino8713
@adultishgambino8713 4 жыл бұрын
How are these tutorials so good? I’ve watched so many Java/Coding tutorials, none have conveyed concepts as clearly and effectively as you
@mohankumartech8396
@mohankumartech8396 4 жыл бұрын
Yes... Don't quit bro. Usually I don't comment in tutorials but your tutorials did make me comment. Because your way of teaching is simply and straight to the point. Keep up the Good wok.
@vadrudnev
@vadrudnev 3 жыл бұрын
Man, you can't even imagine how helpful your tutorials are! You saved a lot of headaches for me!
@kseniaeugene7177
@kseniaeugene7177 4 жыл бұрын
Nice video and all but you didn't explain the most important thing about 'static'. 'static' means that there is only ONE instance of that object that lives inside the JVM. Meaning that when you create a new instance of a class, that class doesn't get a brand new 'a' in your example. In other words 'a' belongs to the class and not its objects. What's nice about it is you can access that 'a' through the class name without creating its instance.
@tawsifiqbalshurid5773
@tawsifiqbalshurid5773 2 жыл бұрын
Thanks this helped.
@echiang73
@echiang73 4 жыл бұрын
Awesome tutorial with great explanation, this is definitely a confusing concept and you make it easier to understand! BTW, static or "stand still" does make sense...the static variable can be used to refer to the common property of all objects (i.e. not unique for each object). For example, the college name of every student for a particular college. Suppose there are 100 students in my college, now all instance data members will get memory each time when the object is created. All students have its unique name, studentID, SSN, etc, so there is an instance variable for each student object. But, "college" refers to the common property of all objects. If we make it static, this field will get the memory only once. Since the static variable gets memory only once in the class area at the time of class loading, it has the advantage to make your program memory efficient (i.e., it saves memory).
@IUfidi
@IUfidi 3 жыл бұрын
Thanks for that...keep the fire burning! 🛸
@SponkADonk
@SponkADonk 2 жыл бұрын
Yes. This. This video would be good to be extended a bit to explain this. Static is used in classes when using inheritance too. Say you have a 'car' superclass and then classes of specific cars as subclasses. Well, (yes I know this wouldn't be necessary in reality) each car has 4 wheels so you could have a 'static int wheels = 4;' in the car superclass. It would be, as explained above, called one time into memory when the superclass is called and then each class for individual cars would be able to reference that without calling it EVERY time one of their individual car objects is called. That is nice for memory. Also, saves a little code. Hopefully that helped expand this idea.
@nightingale180
@nightingale180 Жыл бұрын
+++ if you want to count the number of object created for that class having static variable , you can increment that static count =0 value each time you create an object and those changes will be reflected for every object you'll create , so let's say static count=0; but you created 1st object and it got incremented it by 1(by using a function) that is now count=1; so next time when you'll create 2nd object the count will become 2; So this variable occupies single space in the memory and it is shared among every object of that class, so changes made by one object will be reflected back for every object.
@petervinzasuncion6407
@petervinzasuncion6407 4 жыл бұрын
Your tutorials are great. Its very clear and informative. Im kinda binge watching your tutorials for a couple of days now. Im afraid I might finish watching all your videos within a month.
@petervinzasuncion6407
@petervinzasuncion6407 4 жыл бұрын
I hope you make Encapsulation tutorial next.
@Louyark
@Louyark 3 жыл бұрын
When instantiating an object you make a copy of only the non-static methods and attributes of that class but, the static part "attributes/methods/other" is excluded from the instantiated objects and remains unique to the class itself "only one reference exists". This makes it a great way to store metadata about your class and its instances. So normal variables are copied each time you instantiate a new object but static variables are only created once at the class declaration hence the keyword static. Also thanks for bringing this up this helped me dusting off some cobwebs somewhere in my brain :).
@anthonymaestas7298
@anthonymaestas7298 3 жыл бұрын
Im about to cry over here... the extra three steps you speak of have haunted my life for the past 3 years. Thank you so much for clearing that up!!! You got a thumbs up and sub from me bud!
@עדןמזור
@עדןמזור 5 жыл бұрын
I think it's called static because it's place in the memory doesn't change or something like that, not sure. Nice video BTW!
@alexlorenlee
@alexlorenlee 5 жыл бұрын
Oh right!!
@zachm4389
@zachm4389 4 жыл бұрын
Static means that any class can access it. Normal variables will be different for different instances, and static variables will be the same for the same runtime. If you want a variable that does’t change put ‘final’ before it.
@MrJacqques
@MrJacqques 4 жыл бұрын
@@zachm4389 static has nothing to with who can access the variable. If you do "private static int a", only it's own class can use it.
@ilovedatfruitybooty9546
@ilovedatfruitybooty9546 3 жыл бұрын
@̇ bruh
@vpenywise
@vpenywise 2 жыл бұрын
As pretty much explained in the "Thinking in Java (4th edition)" book :)
@stefan9870
@stefan9870 2 жыл бұрын
Thanks so much Alex, you helped me clear out some missunderstandings regarding static keyword! Keep it up, really appreacite what you do
@oscarvergara6795
@oscarvergara6795 3 жыл бұрын
Same! Through my advanced algorithms class, I literally had no idea when to or not to put the static keyword, but I fumbled around so much with it until I finished my work without knowing exactly what the hell static was meant to do!
@ryanoliver6401
@ryanoliver6401 4 жыл бұрын
You are by far the best tutorial channel that I have found. Now every time I need to learn something I always search for one of your videos. By far, my favorite channel👌🏼
@johnroy5169
@johnroy5169 4 жыл бұрын
absolutely love your stuff, i really feel like I’m getting a better understanding of the language because of how you explain each individual part of it. Keep up the good work bro
@moinhasanfatta3664
@moinhasanfatta3664 Жыл бұрын
Alex you are the best.. Atleast when it comes to java.. Usually I don't comment.. But you deserve one.. Dude
@dragonsea3673
@dragonsea3673 5 жыл бұрын
Best Java teacher ever~ and u have to go through each video "thoroughly" ~ most online teachers just jump from this point to another quickly without explanation and which cause confusion Alex knows our "confusion"
@alejandroirizarrynegron1065
@alejandroirizarrynegron1065 4 жыл бұрын
Love how you simplify these OOP concepts in Java. Thank you :)!
@Adrian_Galilea
@Adrian_Galilea 4 жыл бұрын
Well, I was struggling with this concepts, and I stumbled across a couple of your vids, in this particular one I would recommend checking the video on Static Keyword by Telusko in youtube. This is not spam, I just think it's better explained there. What I understood from that other video summed up: -A static variable will have the same value for all the objects in a class(this is why I think static as a name might make more sense) -Opposite to object variables when you want to change a static variable value, you can call the variable by referencing the class instead of the object. EX: class Emp{ static String ceo; } Emp adrian = new Emp(); Now you can call ceo by: Emp.ceo = "Adrian"; Instead of: adrian.ceo = "Adrian" -The reason why you need to declare it as static it's because main it's also static. -You can create a "static block" in a class (static {//something}) and will be only called once regardless of how many objects you instantiate.
@ariton2990
@ariton2990 4 жыл бұрын
Yes. And another point is that you dont need to create any objects to use static variabe. In ur example you could access ceo variable even without creation of any objects.
@saugatsharma2227
@saugatsharma2227 2 жыл бұрын
Your video’s are amazing. No wonder everybody loves them
@noatorious
@noatorious 3 жыл бұрын
Awesome explanation. My students really benefit from your videos
@maceciliasiva7611
@maceciliasiva7611 4 жыл бұрын
Thanks. Explanations are simple yet well explained
@parth9313
@parth9313 Жыл бұрын
one of the best tutorials i have come across!!! thank you!!!😊😊
@shak876
@shak876 4 жыл бұрын
Why would anyone dislike your videos... your channel is amazing keep doing what you’re doing
@amandabos6166
@amandabos6166 3 жыл бұрын
yeah I agree
@ultra_mega_tronic_source
@ultra_mega_tronic_source 4 жыл бұрын
bro we support you so much...
@adamakomou7318
@adamakomou7318 Жыл бұрын
Thank you so much! You have no idea how insightful this video is.
@gregmoutsinga3109
@gregmoutsinga3109 4 жыл бұрын
it's 2020 and I'm still satisfied, thank u
@kasrak.o2909
@kasrak.o2909 4 жыл бұрын
you deserve it man. im studying IT and your videos really help and more importantly you are really friendly, down to earth and sympathetic which makes me relay to your content alot more than i do to other videos. so keep it on
@portioncontrol
@portioncontrol 3 жыл бұрын
Thanks been obsessing on the static word !
@ronaldisheanesu1157
@ronaldisheanesu1157 4 жыл бұрын
The best tutorials ever Alex. Can you make one about Varargs
@abdeselamselami4532
@abdeselamselami4532 4 жыл бұрын
Thanks a lot Alex, for everyone the short-cut of System.out.println() is type sysout + hit buttons ctrl+space.
@saravananplays8414
@saravananplays8414 3 жыл бұрын
Hey man , you are doing great.Just don't stop java tutorial.it is very useful for cs graduate students
@fararian
@fararian 3 жыл бұрын
I am on chapter 8 of the book for a programming class and i just learned this. thanks for the excellent explanation.
@samirallahverdi4948
@samirallahverdi4948 5 жыл бұрын
İ like the video even not watching it. Because i know it will be useful for beginners
@עדןמזור
@עדןמזור 5 жыл бұрын
Me too
@beatricendalichako2032
@beatricendalichako2032 3 жыл бұрын
You’re making my java classes WAAAYYY easier! Thank u!
@ryanbudfuloski6280
@ryanbudfuloski6280 2 жыл бұрын
You are an incredible teacher! I've watched so many of your videos
@Jeffrey-uw8un
@Jeffrey-uw8un Жыл бұрын
Nice oop lessons mate i appreciate you for these lessons im on my way to the oop exam at uni rn and i think i can pass the exam now i will update after the grades revealed
@archaeniac7846
@archaeniac7846 3 жыл бұрын
"Changes made in an instance variable using one object will not be reflected in other objects as each object has its own copy of the instance variable. In the case of static, changes will be reflected in other objects as static variables are common to all objects of a class." Source - GeeksforGeeks i think this is why its called static
@josephjusino7806
@josephjusino7806 Жыл бұрын
Great explanation. Thank you for your videos. So helpful.
@antkiller98
@antkiller98 5 жыл бұрын
Just started learning java , I’ve watched all your tutorials already and they have helped so much . I can’t wait to watch and learn more , keep up the great work! P.S you have a fantastic way of breaking down each step .
@KG-hb8yr
@KG-hb8yr 2 жыл бұрын
Clean and clear, that's it.
@engyelkafrawy1210
@engyelkafrawy1210 3 жыл бұрын
Thanks Alex for these amazing videos , they are really helpful , i hope you are safe and sound 🙂
@Cablur
@Cablur Жыл бұрын
I think it's called static because the opposite would be an instance method, which is more dynamic/fluid, since it changes depending on the object. But a static variable stays the same, even if you use it from an instance perspective, aka. when accessing it through an object.
@ae6072
@ae6072 4 жыл бұрын
Crazy good content, seriously the best tutorials i've ever seen. You're gonna get really huge. Just keep up with this high quality and explaination and you're set. Good vibes from Sweden!
@joelcarreira5140
@joelcarreira5140 4 жыл бұрын
Thank you for the videos, they are really helpful.
@Benjiz1337
@Benjiz1337 5 жыл бұрын
Keep it up Alex! Your videos really help!
@benjaminhill5408
@benjaminhill5408 3 жыл бұрын
You deserve the views. You don't assume we know anything and that's what people need. I've learned more from you in 1 week of videos than a full semester at college.
@Josip9888
@Josip9888 4 жыл бұрын
And I have suggestion for you. If you would like to give us some project ideas. Like 1 project for begginer, 1 for intermediate and for advanced. For example we had project "Body mass index" for our beginer class, with idea what this application should be used for. I think it's great practice and let people think with their heads :)
@sase1017
@sase1017 3 жыл бұрын
It called 'Static' is because 'static' means the member is pointing to itself, rather than to an instance of object. Another word 'static' tells complier to run directly without creating object in the heap since everything needs to be an object in Java
@erendagdemir9783
@erendagdemir9783 2 жыл бұрын
You are the best.Thank you so much for sharing useful informations.
@fermingonzalez3842
@fermingonzalez3842 5 жыл бұрын
I finally got the static keyword. Thanks bro!
@kszoknyik
@kszoknyik 3 жыл бұрын
Quick explanation, thank you! Going to stick around your channel, I have a Java exam coming up :D
@shauryasingh9553
@shauryasingh9553 3 жыл бұрын
Sir static actually makes sense, there would be only one copy of a static variable, regardless of the number of objects.... You are the best!
@АхтемВейс
@АхтемВейс 3 жыл бұрын
Well buddy, there is a term called singleton - which basically means that there is only one instance for the entire application, and whoever tries to modify it's fields - modifies them in all the instances created of that class. It's just a little portion of static keyword thing that you explained. In fact static methods are the ones that do not depend on class properties or methods - which also means they are sort of deterministic by nature.
@DinQuay
@DinQuay 3 жыл бұрын
Thanks, needed that
@lulav2441
@lulav2441 5 жыл бұрын
Thanks for these tutorials! Keep going please!
@user-rf4vc7mt4d
@user-rf4vc7mt4d 3 жыл бұрын
I’ve always wanted to know this. Thank you so much
@nayrouzhamdy7348
@nayrouzhamdy7348 3 жыл бұрын
THANK GOD YOU KNOW JAVA !!!! You're amazing 😭❤❤❤
@wewonbro1620
@wewonbro1620 3 жыл бұрын
Your channel has been saving my life in college
@kingsman2934
@kingsman2934 4 жыл бұрын
keep it up boss!! We want more!!
@leana8959
@leana8959 2 жыл бұрын
Thank you for the video ! However I want to point out (I believe some other people did too in the comment section) that static also means that all instances of the same class will share the same value of the variable.
@seannoon9581
@seannoon9581 5 жыл бұрын
definitely the best at explaining java !!
@avinashpatil7913
@avinashpatil7913 2 жыл бұрын
"Static" keyword is correct as it does not change for every object. Its class level and shared by all objects so basically its fixed in memory location. Its value can change but it's storage location will be fixed.
@jsprrrr8772
@jsprrrr8772 4 жыл бұрын
dude holy shit you are fking brilliant thank you so much you are such a great teacher plz keep doing this! it's really helping people confused with java!!!!!!!
@amanwaghmare5792
@amanwaghmare5792 3 жыл бұрын
Thank you so much it's helpful
@gingertrilogy366
@gingertrilogy366 3 жыл бұрын
Yea I think this makes. Thanks Alex!
@Mettaworldj
@Mettaworldj 2 жыл бұрын
Static basically means we can access a variable of a class without the class being initiated. Non static methods of the class can access static variables and methods. Static methods can't access methods that are not initiated yet. Static imo is somewhat like dependency injection.
@asmaabdullah9068
@asmaabdullah9068 4 жыл бұрын
simple and sufficient! thank you for this. Although I'd like to add a point, there's another difference between using the keyword "static" and creating an object to access the variable. When you make a variable "static", and change its value in any method, it changes throughout the entire class. However, when you create an object then access the variable from it and alter its value, it will only change for that specific object, not for the entire class. Hope this helps :)
@IUfidi
@IUfidi 3 жыл бұрын
Thanx!
@NexxZt
@NexxZt 3 жыл бұрын
I'm taking a java class right now and i ALWAYS go to your channel after every lecture to have it reexplained by you. You make it so much easier to understand!
@ashishpoudel5927
@ashishpoudel5927 3 жыл бұрын
explain all static block, methods, class and variables
@Jake1702
@Jake1702 4 жыл бұрын
I would have thought "static int a = 0;" would set a as a constant, but that's apparently "final". (Will you make a video about constants?)
@williamtrillion992
@williamtrillion992 3 жыл бұрын
I second this
@imanuelh.399
@imanuelh.399 5 жыл бұрын
UnitTests ?
@thushanmadhulaskshitha5871
@thushanmadhulaskshitha5871 3 жыл бұрын
Thank You brother
@bulaha2978
@bulaha2978 Жыл бұрын
Why don’t you do java tutorial anymore? We love it
@jacobkreifels7690
@jacobkreifels7690 2 жыл бұрын
Static as in the same value wherever it's used. The static keyword essentially tells the program that the object, variable, or method doesn't need an instance of it's parent class to be accessed.
@yankodimitrov5617
@yankodimitrov5617 2 жыл бұрын
Keep the great work dude ! :)
@swarupandurkar8855
@swarupandurkar8855 Жыл бұрын
thank you love from India
@PatrickDucat
@PatrickDucat 4 жыл бұрын
Simply put, if a variable is made static it will not be specific to any one instance. It is shared by every object of that class for the duration of the runtime. It is static in the sense that it stays the same regardless of which instance is accessing it. That is not to say that it's value cannot be changed as with a final. And this is independent of scope.
@sahilk263
@sahilk263 Жыл бұрын
Thanks literally the best explanation i have saw do far..helped a lot !!!!!!
@MelatoninSpirit
@MelatoninSpirit 4 жыл бұрын
Thank you very much! Really useful! Thx to your tutorials I think I can do pretty good during my uncoming exam.
@niskazi7044
@niskazi7044 4 жыл бұрын
you think thousands of views is lot for your videos :P ? brace yourself for millions of views to come your way very shortly 😁😁.
@fuzedcable5612
@fuzedcable5612 3 жыл бұрын
Good vid! U showed the reason for the static creation, and how to use it. But that’s now the definition. Static means that you can’t instantiate it. You cant have multiple instances of it.
@romanmelnychenko3642
@romanmelnychenko3642 3 жыл бұрын
thanks a lot for the content!!!
@DarkArcticTV
@DarkArcticTV 2 жыл бұрын
thanks so much dude you rock
@chadz1148
@chadz1148 3 жыл бұрын
thank you so much man
@DenverWilliam
@DenverWilliam 2 жыл бұрын
Does static not mean that, in terms of memory usage, it does not get removed from memory until the program is completed or returned? So, for constant threads like run or game loops, this means it will occupy memory until the game ends, where non static objects or other will be removed from memory. Also related to memory leaks.
@simkoo2000
@simkoo2000 3 жыл бұрын
Regarding the calender example.. Why not use final int month = 12; instead? I don't get the actual usecase
@mypulsivideos
@mypulsivideos 4 жыл бұрын
but what does the "static" on the methods means? like on the static main
@ljvob
@ljvob 5 жыл бұрын
i'm the first like yeee! :D
@amansinghrajawat8258
@amansinghrajawat8258 2 жыл бұрын
Excellent video!!!!!!!!!!!!!!!!!!!!!!
@yahelbraun5471
@yahelbraun5471 4 жыл бұрын
Good explanation! But when do you need to use that thing?
@ariton2990
@ariton2990 4 жыл бұрын
When you want a variable to be shared between all objects or when you need to access a variable or a method before any object of that class is created.
@rainbow6siege345
@rainbow6siege345 4 жыл бұрын
@@ariton2990 cant you make the variable public?
@ariton2990
@ariton2990 4 жыл бұрын
@@rainbow6siege345 you can but you wont get the same result. Public and static two completely different things.
@rainbow6siege345
@rainbow6siege345 4 жыл бұрын
@@ariton2990 yea i know that a public variable can be shared between the classes and packages but not objects too?
@rainbow6siege345
@rainbow6siege345 4 жыл бұрын
@@ariton2990 sorry dude my college professor cant explain shit he knows all the informations but he sucks at explaing them
@supernovic99
@supernovic99 Жыл бұрын
I have a doubt. In a class, the instance variables apply to all methods so why do we need to create a static variable to do the same thing? Please clear my doubt
@xalicbabygirl
@xalicbabygirl 4 жыл бұрын
I dont know the reason why im here Is it because im struggling in my java subject or because of this handsome man? I think both!
@tylancoleman2862
@tylancoleman2862 4 жыл бұрын
This video helps!
@mistique0vin
@mistique0vin 4 жыл бұрын
Static is that part of the code that executes first before any other part of code. Hope this additional bit of info helps too.
@mahadgady3675
@mahadgady3675 4 жыл бұрын
Thank you so much !😍 , but I have a question if you can help me ?!😊 If that was the functionality of Static what's the difference between it and Protected and Public ?! 😕
@natelion06
@natelion06 3 жыл бұрын
Six thousandth like!! Keep it up and thanks!
@MrMan-sy4ev
@MrMan-sy4ev 3 жыл бұрын
So if the static keyword allows the variable to be known everywhere, does that mean that variable name cannot be assigned a different value elsewhere? Like if we had another class with the variable named “months” and set it equal to 11, would there be a problem since it’s knows the value to already be 12?
@JapanTravelShorts
@JapanTravelShorts 3 жыл бұрын
I would the like to know the answrr as well
Static Method In Java Tutorial #76
5:54
Alex Lee
Рет қаралды 33 М.
Object-Oriented Programming Java Tutorial (Java OOP) #71
14:07
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 5 МЛН
🚨🚨I Got Cited In A Lawsuit....🚨🚨
ThePrimeTime
Рет қаралды 1,5 М.
Negative Time is Real, Physicists Confirm. Kind Of.
6:59
Sabine Hossenfelder
Рет қаралды 12 М.
Meta Has Changed The Game.
10:17
DiscoVR Tetiana
Рет қаралды 6 М.
Static vs Non-Static Variables and Methods In Java - Full Simple Tutorial
11:29
Java static keyword ⚡
8:18
Bro Code
Рет қаралды 115 М.
Access Modifiers Java Tutorial #82
11:27
Alex Lee
Рет қаралды 231 М.
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17