Welcome to Dream.In.Code
Become a Java Expert!

Join 150,058 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,730 people online right now. Registration is fast and FREE... Join Now!




Help with new program

 
Reply to this topicStart new topic

Help with new program

student1010
5 Jun, 2008 - 10:01 PM
Post #1

New D.I.C Head
*

Joined: 5 Jun, 2008
Posts: 3

CODE
class vectorsprog
{      
         public static void main(string args[])
          {
            system.out.println("Enter 3 points in space which form a traingle.");
          }
}

I am just self learning and started my first program. This is the errors i got.

C:\Java\jdk1.6.turn.gif6\bin>javac vectorsprog.java
vectorsprog.java:3: cannot find symbol
symbol : class string
location: class vectorsprog
public static void main(string args[])
^
vectorsprog.java:5: package system does not exist
system.out.println("Enter 3 points in space which form a traingle.")
;
^
2 errors
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Help With New Program
5 Jun, 2008 - 10:16 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,660



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Java is a case sensitive language. Both "String" and "System.out.println" start with capital "S". Otherwise Java doesn't know what those words mean with the lowercase "s".

Also, while it is not crucial, you should specific "public" before the class name unless it is in a file with another class. You will see a lot of examples that show classes starting with the keyword "public" it is just good practice to make it explicit.

Fix those two capitalizations and you will have something that works. smile.gif

This post has been edited by Martyr2: 5 Jun, 2008 - 10:17 PM
User is online!Profile CardPM
+Quote Post

student1010
RE: Help With New Program
5 Jun, 2008 - 10:27 PM
Post #3

New D.I.C Head
*

Joined: 5 Jun, 2008
Posts: 3

QUOTE(Martyr2 @ 5 Jun, 2008 - 11:16 PM) *

Java is a case sensitive language. Both "String" and "System.out.println" start with capital "S". Otherwise Java doesn't know what those words mean with the lowercase "s".

Also, while it is not crucial, you should specific "public" before the class name unless it is in a file with another class. You will see a lot of examples that show classes starting with the keyword "public" it is just good practice to make it explicit.

Fix those two capitalizations and you will have something that works. smile.gif

Thanks.
User is offlineProfile CardPM
+Quote Post

fsloke
RE: Help With New Program
6 Jun, 2008 - 01:59 AM
Post #4

D.I.C Regular
***

Joined: 19 Dec, 2007
Posts: 258



Thanked: 4 times
My Contributions
I recomment you use netbean for the compiler...

NetBean:
http://download.netbeans.org/netbeans/6.1/final/

I Free to download...

You use this compile then you will not type wrong code... Cheer
User is offlineProfile CardPM
+Quote Post

herefishyfishy
RE: Help With New Program
7 Jun, 2008 - 05:22 AM
Post #5

D.I.C Head
Group Icon

Joined: 1 May, 2008
Posts: 60


Dream Kudos: 100
My Contributions
It would work with any IDE that automatically looks up symbols, not just NetBeans. But NetBeans is free, and has a GUI builder.

BTW, you can only make a class public if it has the same name as the source file. Also, there can only be one public class in a file, so if you plan to add another class to your source, you cannot make it public.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 10:33PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month