• Post Reply Bookmark Topic Watch Topic
  • New Topic

multiple classes in a single file  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we write multiple classes in a single .java file?

If yes then, can all of them be public classes

If we have multiple classes in one .java file, what should be the name of the java file?

[ changed the subject to something meaningful - Jim ]
[ November 19, 2007: Message edited by: Jim Yingst ]
 
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

What is "pmr" supposed to mean?

Also, please take the time to choose the correct forum for your posts. This forum is for questions on Servlets.

This post has been moved to a more appropriate forum.
[ November 18, 2007: Message edited by: Bear Bibeault ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI, welcome to the Ranch!

You have a better chance of a meaningful answer if you put effort into your question.

A meaningful topic helps ( I don't know what "pmr" means), as does selecting the correct forum.
 
Ranch Hand
Posts: 97
Linux Python VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have multiple classes in one file, but only one public class. The name of the file should be the same name as the public class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!