What does 'public static void' mean in Java?

后端 未结 9 1057
忘掉有多难
忘掉有多难 2020-11-29 14:29

What does public static void mean in Java?

I\'m in the process of learning. In all the examples in the book I\'m working from public static void

9条回答
  •  渐次进展
    2020-11-29 15:26

    static means that the method is associated with the class, not a specific instance (object) of that class. This means that you can call a static method without creating an object of the class. Because of use of a static keyword main() is your first method to be invoked.. static doesn't need to any object to instance... so,main( ) is called by the Java interpreter before any objects are made.

提交回复
热议问题