wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes why .java filename constraint ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "why .java filename constraint ?" Watch "why .java filename constraint ?" New topic
Author

why .java filename constraint ?

prashant p joshi
Greenhorn

Joined: Jul 22, 2002
Posts: 3
why .java filename must be same as public class name defined in that file?
Sayed Ibrahim Hashimi
Ranch Hand

Joined: May 17, 2001
Posts: 148
I think its because that is how the compiler finds the class files. By package and class name.


SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
It's just a convenience for the compiler.
It's one of the tricks which enable recompiling a whole Java project to be acceptably quick, without needing something like a "makefile" to tell it what to compile.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why .java filename constraint ?
 
Similar Threads
role of interpreter and jti
Slashes being removed when getting URL streams
How to avoid hardcodings while testing
Empty java file
download link in jsp ?