My teacher is trying to explain this but it really makes no sense the way he is explaining it. If I understand from my own research only, static attached to a method means that it can be called without referencing it with an object. IE: (this code isn't correct just want to do something general)
Main function { int i = area(); // This one would work int t = length(); // This wouldn't work unless accessed by an object? Object object = new Object; object.area(); // Wouldn't work? object.length() // Only way the length function could be run? } static int area function { blah blah return k; } int length function { blah blah; return k; }
Hopefully this makes sense. Basically I want to know what the static keyword does. And sorry if they aren't supposed to be called functions, I mean methods. I came from C, and this class is an introduction to object oriented design so its still new to me. Any good sites to learn object oriented design for Java from because my teacher is not the greatest? Thank you!