Why does java not allow multiple public classes in a java file ?
Answer Posted / rahul
java does not support multiple public classes because of there are only one main method to define......and we can not have multiple main methods in a same class....and we know that java code will always save as the name of class name in which main method are define......
Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
What is the difference between Grid and Gridbaglayout?
What is downcasting?
What is oop principle in java?
What is the importance of hashcode() and equals() methods?
Does substring start with 0?
What is super constructor?
What is the default execution method in java?
Can we create our own wrapper class in java?
What is bigger kb or mb?
What is break and continue statement?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
What is meant by final class?
Which browsers work with java?
What is function overriding and overloading in java?
What is time complexity algorithm?