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
Can you extend main method in java?
What are encapsulation, inheritance and polymorphism?
what are the high-level thread states? : Java thread
What are recursive functions? Give some examples?
What is "this" keyword in java? Explain
Why do we need data structure in java?
What is regex java?
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.
Why put method is idempotent?
What is the purpose of an interface?
Explain java thread life cycle.
Is static variable stored in heap?
why not override thread to make a runnable? : Java thread
Justify your answer that you can't define a method inside another method in java, if you can then how?
What do you understand by weak reference?