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

Answer Posted / ganesh slv

Sorry for the above..
its

If you declared a class as public, your file name should be
the same of your class name.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a main method be declared final?

588


Can a list be null in java?

547


What is the equal sign?

567


What are the benefits of operations in java?

493


Can we have a try block without catch block?

571






What are implicit objects in java?

553


How do you check if a character in a string is a digit or letter?

516


Explain how can you debug the Java code?

592


How do you reverse a word in java?

533


What things should be kept in mind while creating your own exceptions in java?

635


Can anonymous class have constructor?

552


What do you mean by object?

552


What is a boolean expression in java?

537


In how many ways we can do exception handling in java?

580


How to perform linear search in java?

570