Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

why we cannot create two public class files inside one java file? elaborated answer please.

what problem jvm faces ?

I'm wondering what you would need to put in for the file name to compile it? Use a dot separator maybe? Because for each java file you get a class file once compiled.

I do know that they allow what are called "inner classes" inside a class.

1 Answer

I am not sure if you understand the concept of Java. Java is mean't to be modular, with each method assigned 1 task and each class for a specific purpose.

Continue learning Java, and some other non-OOP language like C and you will better understand why Java is the way it is.