A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
why .java filename constraint ?
prashant p joshi
Joined: Jul 22, 2002
Jul 22, 2002 00:43:00
why .java filename must be same as public class name defined in that file?
Sayed Ibrahim Hashimi
Joined: May 17, 2001
Jul 22, 2002 04:25:00
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>
Joined: Jan 07, 1999
Jul 22, 2002 05:31:00
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
It is sorta covered in the
JavaRanch Style Guide
subject: why .java filename constraint ?
How to avoid hardcodings while testing
Slashes being removed when getting URL streams
download link in jsp ?
role of interpreter and jti
Empty java file
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013