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
Do I need java on my pc?
Can an integer be null java?
What is difference between final and finally in java?
Explain the selection sort algorithm?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
What are decalarations?
Explain the difference between comparator and comparable in java?
Is ++ operator is thread safe in java?
Can a class have multiple constructors?
What does math floor () do?
What's the difference between an abstract class and interface in java?
Which non-unicode letter characters may be used as the first character of an identifier?
Are arrays classes in java?
Is there is any difference between a scrollbar and a scrollpane?
What is the difference between C++ and Java and your preferences?