Why only one Class is public in one file? Explain in
details. Thanks in Advance.

Answer Posted / mahendra

In an aplication public class is main class with main()
method as entry point

java compiler allows only one public class in file

Is This Answer Correct ?    12 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null a string?

550


Why do we need wrapper class?

535


Explain a few methods of overloading best practices in java?

505


What is a boolean used for?

586


How do you reverse a string in java?

577






How can you set an applet’s height and width as a percentage?

511


Write a program to check string is palindrome without using loop?

565


What is the map interface in java programming?

585


What is wrapper class example?

533


How does the garbage collector works in java?

568


Why is string buffer better than string ?

594


What is a local, member and a class variable?

574


What’s the difference between unit, integration and functional testing?

614


Explain the difference between hashmap and hashtable in java?

487


What is an exception in java?

644