Re: help me in java
brainbarshan wrote:
hi! i [sic] am new in java [sic]. i am just trying to learn it.
The newsgroup comp.lang.java.help is perfect for this kind of question.
comp.lang.java.advocacy is for the expression of in favor of or against Java,
for or against parts of the language, for or against new features, or for or
against related products or projects.
but when i am trying to run the class file by java ap1.class
The "java" command takes a class as an argument, not a file. Class names are
similar to file names, but without the ".class" part, so you should type:
java ap1
There are coding conventions for Java that one should begin class or other
interface names with an upper-case letter, and (most) variable and method
names with a lower-case letter. Use single or compound words for names, such
as "class SomethingNifty"; each compound word part other than the first begins
with an upper-case letter for both classes and variables or methods. So you
should get in the habit, using your example, of naming a class like:
public class Ap1
and you would invoke it with
java Ap1
Later you will learn about packages, which would give you a command like:
java com.lewscanon.SomethingNifty
Read the material at <http://java.sun.com/>, especially the tutorials.
Please follow up at comp.lang.java.help . Another good newsgroup is
comp.lang.java.programmer but it is somewhat more advanced.
Although the command to invoke a Java program is "java", the name of the
language is "Java". The language itself is very picky about upper- and
lower-case spelling, so it's a good idea to get in the habit of rigor about
letter case generally.
--
Lew