answersLogoWhite

0

What is void main?

Updated: 8/16/2019
User Avatar

Wiki User

11y ago

Best Answer

The main method is the first method, which the Java Virtual Machine executes. When you execute a class with the Java interpreter, the runtime system starts by calling the class's main() method. Themain() method then calls all the other methods required to run your application. It can be said that the main method is the entry point in the Java program and java program can't run without this method.

The signature of main() method looks like this:

public static void main(String args[])

The method signature for the main() method contains three modifiers:

  • public indicates that the main() method can be called by any object.
  • static indicates that the main() method is a class method.
  • void indicates that the main() method has no return value.
User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is void main?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why to write void main in c programing?

it is always not necessary to write "void main " in c programming.it depends on the source code we use if we have to return a value then void is not necessary because void returns the null.While coding in borland C++ we need to write void main but we dont need it in dav c++.In C (and C++) the standard allows int main (void) and int main (int argc, char **argv)


What is the role of void in functions of c?

this is a void main()int, char, are execution the program and it is not return the void.


C progamme for conversion of Celsius to Fahrenheit using array?

main void void void (void) { float temp1 [13]= {1,4,2,3,4,5,7,88,9,4,3,23,12};


What is the function of void main in c language?

Actually, it is:int main (void)orint main (int, char **)the point where the execution of the program begins


A pointer to a function which receives nothing and returns nothing?

void (*funptr)(void); void fun (void); int main () { funptr = fun; funptr (); }


Is it compulsory to write static with void main?

Every C# application is started on the startup class' static Main method. Yes, it must be static, but void is not the only returned type. The 4 signatures:static void Main();static void Main(string[] arguments);static int Main();static int Main(string[] arguments);Ideally, there should be one and only one Main method in your application.


Where the printf statements are stored in memory?

Try this: #include <stdio.h> int main (void) { printf ("printf is at location %p\n", (void *)printf); printf ("main is at location %p\n", (void *)main); return 0; }


How do you call a function for expressing thanks?

void expressing_thanks (void) { puts ("thanks"); } int main (void) { expressing_thanks (); return 0; }


What are the valid signatures of the main method of a class?

The main method can be declared as either of the below: public static void main(String[] args) or public static void main(String args[])


Where void main is called in c?

main() is the function from where the execution starts.


Can be declared the structure in void main?

yes


How is main function declared?

int main (void) or int main(int a, char **p)