❮ Java Keywords ExampleGet your own Java Server A static method can be accessed without creating an object of the class first: public class Main { // Static method static void myStaticMethod() { System.out.println("Static methods can be called without creating objects"); } // Public ...
staticis not supported in Internet Explorer. Syntax staticmethodName() Technical Details JavaScript Version:ECMAScript 2015 (ES6) More Examples If you want to use the mycar object, inside the static method, you can send it as a parameter: ...