Quantcast
answersLogoWhite
notificationBell

Top Answer
User Avatar
Wiki User
Answered 2008-09-18 19:59:10

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

001
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
๐Ÿ˜‚
0
User Avatar

Your Answer

Still Have Questions?

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.



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.


What is main in java?

The main in Java is the entry point of the program. A Java program starts from main. main is a function. Java is an object oriented language. It means that everything in Java can be called only through objects. But how does a program start? something must be able to create an object isn't it? for this there is main function. Notice the declaration of a main function it will be as :-public static void main(String[] args) {}Here public indicates that the function that you call can be called anywhere from the program(out side the declared classes). static is a keyword which tells that you can directly call a function (in this case main) without creating an object for the function. void tell that the function main doesn't have a return type. In effect public static void main() {}, act as the entry point of the java program.Remember there will be only one main function in a Java class. Then objects are created inside the main function inside the Java program likepublic class Test {public static void main(String[] args) {MyClass obj = new MyClass();obj.myFunction();}} // end of Test classclass MyClass {public void myFunction() {System.out.println("I am from MyClass");}} // end of MyClassThe output of the program would beI am from MyClass


Is the any class containing main function in a webapplicatin?

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


What is return type of main function?

The return type of main is void in Java, int in C and C++.


What is the difference between main function in C java?

// C int main(int argc, char** argv) { return 0; } // Java class MainClass { public static void main(String[] args) { } } Differences: * Java main method must be in a class; C has no class, so no such requirement exists. * Both accept an array of command-line args. * ** Java arrays know how long they are; C does not and thus the main function must have an additional parameter to know the length of the array. * The Java main method has a specific format; the C main function seems to be allowed to differ. * ** The C main function seems to be able to accept different numbers of arguments and have different return types (assuming the implementation allows it).


Why void is restriction in java main function?

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


What is the default return type of main?

'Main' is not at all associated with the return type. Specifying a function as main means that the function is to be executed first when the class is executed. A program can have only one 'main' function.Answer:The C standard ISO/IEC 9899 dictates that the return type of main() should be int.Edited by Vijay DuggiralaIt is void for Java. Which means that main in java returns no value.


In java public static voidmain function denotes what?

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


What are three difference between the visual basic python and java programming languages?

Programming languages share a lot of the same characteristics. One main difference between Java and Python is the function identifier. In Java it is function and in Python it is def.


Why we write main method is static in java program?

The main function is a global function and there can be only one instance of any global function. As such, all global functions must be declared static.


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.


Difference between main function and public static void main?

void main() function just declares a function with return type void..but in java during execution of the program to call the members of a class before an object is created we declare the members as static..so main function must always be declared as static so that it must be called before object is created..and it is declared as public because it can be accesed by code outside the program...main function will not be executed if it is not declared as static in java..


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 are applets?

Applets are small java programs that can be run on our computer and transferred through Internet .They do not have main function.


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.


Why main function written as public static in java?

in java programming langauge the main function is declear as static and public because in oops(object oriented programming) every public function is accessable any where in our source code , but the matter of static is different from this in a class every static function is called without object so we do not declear a object for our class in our code


What is the function of src folder in android?

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


What is main class in a Java program?

Object is the main class in Java Program


What is the main topics in Advance Java?

Advance java is the advance version of core java. The main topics that includes in advance java are struts , hibernate, springs, java beans etc . Also java mail and Java database connectivity can be implemented.


What are the Main Islands of Indonesia?

Sumatra, Java, Sulawesi, Irian Jaya, KalimantanJava,Kalimantan,Sulawesi,Papua are the main islands in Indonesia. Java,Kalimantan,Sulawesi,Papua are the main islands in Indonesia. Java,Kalimantan,Sulawesi,Papua are the main islands in Indonesia. Java,Kalimantan,Sulawesi,Papua are the main islands in Indonesia. Java,Kalimantan,Sulawesi,Papua are the main islands in Indonesia.


Which api used in java?

The Java API is the API for the main Java Library.


Still have questions?

Trending Questions
Previously Viewed
Unanswered Questions
Is E635 halal? Asked By Wiki User
Why we require Microsoft paint? Asked By Wiki User