Is it possible to have more than one public class in the same file?

1 answer

Answer

1249140

2026-07-12 02:00

+ Follow

Java
Java

No. There can be multiple Java classes in the same .Java file, but the name of the file must match the name of the public class in the file.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.