Java public class | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 9

Java public class

Why there is only one public class per Java file? Any help would be appreciated.

13th Jun 2018, 4:49 AM
Rstar
Rstar - avatar
1 ответ
+ 1
We have to make the java file name as the name of the file.Since each java file has unique name,hence our java file has only single public class. THIS IS MY LOGIC...THERE MAY BE ANY OTHER REASONS FOR THIS😀
14th Jun 2018, 9:22 AM
Brajesh Kumar
Brajesh Kumar - avatar