In Java why we write public static void main(String args[])
why not main()?
Answer Posted / kanchan bangar
In java if we are not writting public static void main
(String args[]) then program is only compield not run
that's why it must write because compiler in java always
look the main function and when compiler always calls the
main class is loaded in frist time call for that static
keyword is used and public is for access everything means
methods and member variabls of any pakage and classes or in
super class and meand it does not return any value.
Is This Answer Correct ? | 18 Yes | 57 No |
Post New Answer View All Answers
What is static block?
we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.
In java, what is the difference between method overloading and method overriding?
How do you read a char in java?
How do I stop concurrentmodificationexception?
What is the purpose of sizeof operator?
What is Classloader in Java?
What is a variable simple definition?
What are the differences between forwarding () method and sendredirect() methods?
What is thread count in java?
What is the difference between heap memory and stack memory?
Can we sort array in java?
How do you create a method in java?
What do you mean by scope of variable?
What is the synonym of framework?