Why only one Class is public in one file? Explain in
details. Thanks in Advance.
Answer Posted / madan
public static void main(String args[])
this is command line args.. we need to declare public because, this is the main method, from any class, any package, we have to call, so it will be public.. same as class is also public...suppose, if u declare two class as public, it show error, we have to save a file somefile.java...
i think u understood based on above explanation..
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What do you mean by inner class in java?
What is regex in java?
What is e java?
What is parse method?
How do you compare values in java?
How do you sort objects in java?
Can you declare a private method as static?
What are the differences between path and classpath variables?
What are the library functions in java?
Is java call by value?
Is null a keyword in java?
Is 0 an irrational number?
What is string [] java?
how its run?
What is classes in java?