Re: question-- a little confused
Xiaoshen Li <xli6@xxxxxxx> wrote:
> I know my program will work if I put class Money alone in the file
> Money.java, put class Driver alone in Driver.java and just compile
> Driver.java. But I hope to find out why what I am doing is not working
> and how I can make it work.
You should put these classes in separate files. In the end, it really
doesn't matter if you could convince the compiler to accept the code as
is. It is univerally accepted Java programming style that a top-level
class should be declared in its own source file. There is simply no
good reason not to comply with that convention.
If you think you have such a reason, please enlighten us... maybe
someone can help solve your actual problem.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
.
Relevant Pages
- Re: Changes in 2005.
... VS.NET 2003 does not compile to unmanaged code. ... There is all the more reason for startups to write Web-based software now, ... are going to tell me that you would rather write an ASP.NET app ... (microsoft.public.dotnet.languages.csharp) - Re: Include Statement
... For the same reason conditional compilation directives were added to compile a block vs not to compile a block. ... For the same reason you have IMPORTS to reference an compiled object. ... Second, it is difficult to explain all the reason because they are VAST, every programmer has their reasons. ... (microsoft.public.dotnet.languages.vb) - Re: Include Statement
... For the same reason conditional compilation directives were added to compile a block vs not to compile a block. ... Second, it is difficult to explain all the reason because they are VAST, every programmer has their reasons. ... Like without out product line source codes, look at other large projects where the source code is LOADED with both imports and includes - because the language allowed it. ... (microsoft.public.dotnet.languages.vb) - Re: Reading text file contents to a character buffer
... I don't mind either way, ... is trivial to link C with C++ and preferable to compile the C with a C ... C++ libraries, rather than copy and paste code. ... Probably because there isn't a good reason for writing C on that platform. ... (comp.lang.c) - Re: FreeBSD Security Advisory FreeBSD-SA-05:21.openssl
... >> Is there any reason why one would need to compile the whole operating ... > management:) and I think also the main reason FreeBSD isn't so widely ... "why compile everything instead of just openssl" ... (FreeBSD-Security) |
|