In Java why we write public static void main(String args[])
why not main()?

Answer Posted / sumalatha

yes in every progrm in jave the main is static.because when
the program will start ,thit means runnig then the main is
also one method it was called first that means without
instans creations the main is called.thet is the reason we
are put as main is static method(static is used for without
instance creat u call it).void means it does not reaturn
any value

Is This Answer Correct ?    148 Yes 43 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an object in java and how is it created?

591


Is string a wrapper class?

519


Can we override a variable in java?

555


What is fail fast in java?

576


What is the difference between jdk, jre, and jvm?

576






What is the base class of all exception classes?

588


What are heap memory and stack memory and what are memory tables.

515


How to perform linear search in java?

569


What is the set interface in java programming?

631


How to invoke external process in java.

574


Why java does not support pointers?

563


please send me hr interview questions in it industry

1672


Is it possible for a yielded thread to get chance for its execution again?

516


Who developed java?

574


Explain about transient variables in java?

649