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
Can you have two constructors in java?
Can we inherit a class with private constructor?
What is stored procedure. How do you create stored procedure ?
Can you use this() and super() both in a constructor?
Is linkedlist thread safe in java?
What is hashmap and map?
In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?
What is classpath?
What is a lock or purpose of locks in java?
Why local variables are stored in stack?
Can a class have more than one object?
How would overload a function based on return type?
What is map and hashmap in java?
How do you do a line break in java?
What is the list interface in java programming?