What is the difference between main() and Main()

Showing Answers 1 - 5 of 5 Answers

jayaprada

  • May 12th, 2006
 

what is the difference between Main() and main()?

  Was this answer useful?  Yes

vishav

  • May 13th, 2006
 

java is case sensitive. if u write 'Main' instead of 'main' ur program will compile if it doesnt find main method. But interpretor will not run the class file because it will not get the main and will give a error message.hope u got it.

  Was this answer useful?  Yes

manish

  • May 24th, 2006
 

     main() and Main() both are known as user defined methods since java is a case sensitive language it differs main()  from Main() all the java application must have this main() because by defaultly the execution should be start from main() only if we r not having any mains in our program the static block is executed.

  Was this answer useful?  Yes

rabbi

  • Jun 29th, 2006
 

main() and Main() are two different methods in Java. But if u write Main() instead of main() then there will no exception at the compile time. But It will generate a runtime exception :     java.lang.NoSuchMethodError: main    

  Was this answer useful?  Yes

cntganesh

  • Aug 31st, 2006
 

Java is case sensitive.if you change main to Main program will compile.while running using java in command prompt its shows error

Exception in thread "main" java.lang.NoSuchMethodError: main

main() is a entry point.program start from there. its a method. it is public can be accessed. static method no need create object.

you can have user defined method named  Main() 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions