why we write public static void main (String args[])
in core java plz explain briefly??????????????????

Answer Posted / anand kumar jha

we write public because it can be called from outside the envornment and as we know that by using public keyword we will be able to access all the codes from outside,static is used because the JVM(java virtual machine which is also called as the interpreter calles the main function when there is no declaration of class instances so if we dont use static then the interprter will not check for it ,we use string and its a kind of class.It is also known as the commad line argument.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you extend main method in java?

607


What are encapsulation, inheritance and polymorphism?

519


what are the high-level thread states? : Java thread

550


What are recursive functions? Give some examples?

608


What is "this" keyword in java? Explain

649






Why do we need data structure in java?

562


What is regex java?

550


Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.

1600


Why put method is idempotent?

452


What is the purpose of an interface?

548


Explain java thread life cycle.

574


Is static variable stored in heap?

497


why not override thread to make a runnable? : Java thread

547


Justify your answer that you can't define a method inside another method in java, if you can then how?

596


What do you understand by weak reference?

548