main() in C, C++, Java, C#

前端 未结 9 1503
心在旅途
心在旅途 2020-12-11 06:20

Is main() (or Main()) in C, C++, Java or C#, a user-defined function or a built-in function?

9条回答
  •  心在旅途
    2020-12-11 06:39

    In Java main(String[] args) is the entry point for applications by convention (to make C++ programmers comfortable). For applets or servlets the invocation of code happens differently. Note that a jar may contain any or none of these entry points and that each class may contain a main so a given jar can be invoked in many different ways as an applcation if so desired.

提交回复
热议问题