Why do we use public static with the main function in Java?
Answers were Sorted based on User's Feedback
Answer / abhi
why all these guys used to say "no need to create objects for a static class" tell what advantages u wil b geting without creating an object.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ankit
public is written so that it can be called from outside and
static is written because main is called before the creation
of any object and for static methods object is not required.
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / deepak divvela
In the main function generally we are using
public static void main(String args[])
that means public is used for call method without being the
member of the class.
and static is used for to call method directly with no need
of the object creation.
| Is This Answer Correct ? | 3 Yes | 7 No |
Is an object null?
Hai friends I am MCA 2006 passout. Spend time in 1 yr for teacing and 5 months in small s/w firm. worked in 4 or 5 months in few places. Presently I am writing bank exams. I want to get back to IT sector. Are there any possibilities. any growth prospects?. I am having some knowledge in core and advanced java. I am so desperate. Any suggestions thanks in advance. u can write to my mail mahidestiny@gmail.com
What is t in generics in java?
What is the difference between length and size in java?
Difference between ‘is-a’ and ‘has-a’ relationship in java?
Can we define private and protected modifiers for the members in interfaces?
What is your platform’s default character encoding?
Is void a data type in java?
What is array length?
What is the purpose of the return statement?
Can a top level class be private or protected?
how to print hello world every second till i have pressed enter key ???