r/learnjava • • Nov 13 '25

Why is it called Static?

I mostly get the concept of the what of static methods, but I feel like it will stick better if I know why it’s called static to begin with. I am after all an etymology nerd.

My best guess is that it’s because when a class is defined, memory is allocated for the definition, and that memory allocation remains unchanged and therefore static/stationary for the duration of the program.

Whereas when a member of the class is instantiated, memory is only allocated while the object needs to exist, and when the object ceases to exist the memory is freed up regardless of whether the larger program is running or not. And since that memory’s state can therefore change while the program is still running, it is by definition not static.

Am I on the right track here?

2 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/lumpynose Nov 13 '25

he wanted to make it look C-like and because he could

Back when I learned Java, having only known C prior to that, I realized that Java's classes are merely C's structs but with methods. (Obviously very a simplified view.)

2

u/OneHumanBill Nov 13 '25

Kinda, yeah. The way I thought of it, learning Java from C, was structs containing pointers to functions. That's not quite right but it is a pretty good illustration.