|
-
Dec 21st, 2006, 01:43 PM
#1
Thread Starter
New Member
File name
can someone pls tell me why we always have to save the prog file with the same name as the main class.if i don't i get a strange error message.
-
Dec 23rd, 2006, 10:38 AM
#2
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 24th, 2006, 12:38 AM
#3
Lively Member
Re: File name
I think he means why do you have to save the class in a file with the same name.
-
Dec 24th, 2006, 04:43 AM
#4
Re: File name
Because of Java's class lookup rules. Java computes the name of the file storing a class from the class name. That's the short version. For the long version, search this forum for posts by me containing "classpath" and "class loader", or browse the web.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|