LimWei  

The difference between Python and Java in run a program

  1. In Python, we can run a single line of code at the shell, or we can run an entire module. A Python module is simply the code that exists in a single file. When we run a module, the code is executed from top to bottom.
  2. In Java, we don't have the concept of a module. Instead, everything is organized around classes. When we execute a program in Java, we actually execute a class. Of course, a class may have multiple methods in it, so which one is executed? There is a special method called main that any class may define. If we run that class, the main method is executed.

    class Hello {

          public static void main(String[] args) {

                // The method body will go here.

          }

    }

Question mark:public static void main(String[] args) the meaning of the other parts of the main method.

Question mark: What is module and what is shell

posted on 2018-01-16 09:53  LimWei  阅读(136)  评论(0)    收藏  举报