help my first java program  
Author Message
Gary Redmond





PostPosted: 2004-9-19 3:32:00 Top

java-programmer, help my first java program This is my first attempt at java

here it is


public class Welcome {
public static void main(String[] args){
System.out.println("Welcome to java");
}
}

however when i compile it i get this error

C:\Java>javac Test.java
Test.java:3: package system does not exist
system.out.println("This is a test");
^
1 error

what am i doing wrong



 
Adam





PostPosted: 2004-9-19 4:13:00 Top

java-programmer >> help my first java program > public class Welcome {
> public static void main(String[] args){
> System.out.println("Welcome to java");
> }
> }
>
> however when i compile it i get this error
>
> C:\Java>javac Test.java
> Test.java:3: package system does not exist
> system.out.println("This is a test");
> ^
> 1 error
>
> what am i doing wrong

The code at the top seems ok, but below it looks like you've spelt 'system'
with a lowercase 's'.
it needs to be System with capital S.

adam


 
Gary Redmond





PostPosted: 2004-9-19 4:34:00 Top

java-programmer >> help my first java program the code down below is what the command line is giving back to me

"Adam" <email***@***.com> wrote in message
news:cii4s3$m6u$email***@***.com...
>> public class Welcome {
>> public static void main(String[] args){
>> System.out.println("Welcome to java");
>> }
>> }
>>
>> however when i compile it i get this error
>>
>> C:\Java>javac Test.java
>> Test.java:3: package system does not exist
>> system.out.println("This is a test");
>> ^
>> 1 error
>>
>> what am i doing wrong
>
> The code at the top seems ok, but below it looks like you've spelt
> 'system'
> with a lowercase 's'.
> it needs to be System with capital S.
>
> adam
>
>


 
 
Gary Redmond





PostPosted: 2004-9-19 4:36:00 Top

java-programmer >> help my first java program sorry my mistake it works fine now thanks


"Gary Redmond" <email***@***.com> wrote in message
news:7Z03d.29633$email***@***.com...
> the code down below is what the command line is giving back to me
>
> "Adam" <email***@***.com> wrote in message
> news:cii4s3$m6u$email***@***.com...
>>> public class Welcome {
>>> public static void main(String[] args){
>>> System.out.println("Welcome to java");
>>> }
>>> }
>>>
>>> however when i compile it i get this error
>>>
>>> C:\Java>javac Test.java
>>> Test.java:3: package system does not exist
>>> system.out.println("This is a test");
>>> ^
>>> 1 error
>>>
>>> what am i doing wrong
>>
>> The code at the top seems ok, but below it looks like you've spelt
>> 'system'
>> with a lowercase 's'.
>> it needs to be System with capital S.
>>
>> adam
>>
>>
>
>


 
 
Hal Rosser





PostPosted: 2004-9-19 5:19:00 Top

java-programmer >> help my first java program
> public class Welcome {
> public static void main(String[] args){
> System.out.println("Welcome to java");
> }
> }
>
> however when i compile it i get this error
>
> C:\Java>javac Test.java
> Test.java:3: package system does not exist
> system.out.println("This is a test");
> ^
> 1 error
>
> what am i doing wrong
You should have named the file "Welcome.java" - not Test.java - the file
name and class name should be the same here.
You are compiling "Test.java"
-- by the way, the error message indicates you did not use upper-case S in
"System"
if you rename the file "Welcome.java"
and compile using "javac Welcome.java
you'll hava better luck
=====================


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 9/17/2004