#java static keyword
19 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @gilded dune! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
In Java most things are done using objects
these objects are created using classes.
you call methods with these objects that usually do certain work, such as updating the object's data etc.
when you say static you are telling java not to use an object
an example would be Math.abs(double a)
it's called in isolation of any particular object of the Math class
if it were non-static, I would be forced to use a Math object to call the method like this: Math math = new Math(); math.abs(-5.0);
Thanks! Could you give me a small example?
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
no good
example is here
ok, i will try to do something, but i think have understood it
thanks
these are some resources on it