Re: Noob Java Error
lucifer wrote:
Hi i m learning java n
Please learn that word is 'and'.
i have written the following program but it does not compile
Did you have a question?
In the meantime, I will make some comments..
1) A good group for those learning Java is comp.lang.java.help
2) Even on c.l.j.h., people will generally expect you to ask a
question, rather than have the reader simply guess what you want.
...
import java.io.*;
import javax.servlet.*;
3) Servlets are part of J2EE (or JEE - whatever Sun
is calling it at this instant). J2EE is intended for
the server side, and before attempting it, it is best
to be proficient at J2SE (meant for the desktop
and core Java), at least to the point of solving basic
compilation errors, adding resources to the compilation
or runtime classpath, and naming files. Not only is
J2EE built on the J2SE, but standard J2SE classes
are a lot easier to develop and debug than J2EE
classes - that might be cached by a servlet container,
and which present errors in a web page.
I strongly advise you to forget J2EE for the moment,
and learn J2SE.
But to the first of the errors that you will need
to understand for either J2SE or J2EE..
simple.java:4: class Simple is public, should be declared in a file
named Simple.java
Java is case sensitive. "simple.java"!="Simple.java"
This file *must* be called Simple.java, if the class is declared
public. (Though it is generally a good idea to have *every*
class in a separate file of exactly the same name as the
class, whether it is public or not).
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200706/1