Click to See Complete Forum and Search --> : About file compilation


sheelu_k
October 14th, 1999, 02:54 AM
Hi,

I am working in java from 6 months, but whenever I tried giving different names for .java file & the class name inside the file, I got the Error saying both should be same. But yesterday I tried giving different names, it worked fine. Please give me the Answer. I am in a big confusion.

Thanks,
Rgds,
Shivaleela.

ailing
October 14th, 1999, 10:12 PM
hi. i never encounter such problem before.
Note: the naming is case-sensitive.

hope this help
ailing.L

unicman
October 15th, 1999, 02:57 AM
U may have declared the class as 'not public'. The name of the 'public' class in a java file should be same as that of the file name. A java file can contain multiple classes, but only one class can be public. And the name of the file should be same as that of the public class.

- UnicMan
http://members.tripod.com/unicman