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
Can we override the overloaded method?
What are the 7 types of characters?
How can you make a class serializable in java?
Explain a situation where finally block will not be executed?
Explain the features of java?
What are the parts of methodology?
Program to Find the second largest element in an array.
Explain the difference between call by refrence and call by value?
Is space a string in java?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
What are the advantages of functions?
how we can create packages in java?
What is comparable and comparator interface? List their differences
How do you declare an empty string?
What is an empty list in java?