Why do we use public static with the main function in Java?

Answer Posted / manya

main function is used for two purposes:-1)when you have to
write a recursion code.2)to use command line arguments

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are 3 data types?

538


Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?

608


What do you mean by inner class in java?

562


What does 3 dots mean in java?

512


How dead lock situation occurs in java and how you can identify it?

538






What java is used for?

654


What do you mean by platform independence?

580


What is an class?

589


Are arrays primitive data types?

632


What state is a thread in when it is executing?

525


Explain the advantages of packages in java?

513


What is reverse function?

569


What is the benefit of inner classes in java?

601


What are the two types of java?

515


Explain the difference between jdk, jre, and jvm?

588