answersLogoWhite

0


Best Answer

You can not overwrite a static method in Java,and 'main' is a static method.so,you can't overwrite the 'main'.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

Yes, the main method is just like any other static method.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Sure you can. But, the only method that will get invoked when you try to run the class is the method with public static void main as the qualifier

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you overwrite main function in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Who invoke main function in java?

The Java Runtime Environment invokes main methods.


Is main a predefined function in java?

No. It is a user defined function which the person who is creating the java class has to code by himself.


In java public static voidmain function denotes what?

Java's main function denotes the entry point into the execution of your program.


Can we execute java program without main function?

no


What is the name of the function which must be defined in a Java program?

The main function. Every program must have a main function and it must be declared static.


Is the any class containing main function in a webapplicatin?

No. Java classes in web applications do not have Main Methods.


Why void is restriction in java main function?

becoz the main program doesnot return any value to the os.


What is a main function in java?

the main function or main method is the first method that gets invoked when you try to run a java application. Any class that has a main method can be executed in a standalone fashion. A typical main method would look like below: public static void main(String[] args) { … // code goes here }


Why every program runs with its main class name in Java?

The "main" function name is reserved and specifies the entry point of the application.


What is function in java terminology?

In Java, a function is called a "method". In Java as well as other languages, a method is a function defined specifically for one class. In Java, this is the only way to define functions, therefore, all functions are methods.In Java, a function is called a "method". In Java as well as other languages, a method is a function defined specifically for one class. In Java, this is the only way to define functions, therefore, all functions are methods.In Java, a function is called a "method". In Java as well as other languages, a method is a function defined specifically for one class. In Java, this is the only way to define functions, therefore, all functions are methods.In Java, a function is called a "method". In Java as well as other languages, a method is a function defined specifically for one class. In Java, this is the only way to define functions, therefore, all functions are methods.


What is the function of src folder in android?

In Android Development the src folder is where all you put your main Java code


Why main is used in java?

In java need main() method. without main() in java we won't run the java programe main() signals the entry point to the program - it tells the Java Virtual Machine which is the first program that should be executed.