Content deleted Content added
m Reverted 3 edits by Kartik2930 (talk) to last revision by GünniX |
Tags: Mobile edit Mobile web edit |
||
Line 260:
===<code>main</code> method===
Every Java application must have an entry point. This is true of both graphical interface applications and console applications. The entry point is the <code>main</code> method. There can be more than one class with a <code>main</code> method, but the main class is always defined externally (for example, in a [[manifest file]]). The <code>main</code> method along with the main class must be declared <code>public</code>. The method must be <code>static</code> and is passed command-line arguments as an array of strings. Unlike [[C++]] or [[C Sharp (programming language)|C#]], it never returns a value and must return <code>void</code>.
<syntaxhighlight lang=Java>
public static void main(String[] args) {
|