Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: What's the damn error in this program...

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation What's the damn error in this program...

    please identify error in this basic program
    it's in SCJP directory
    SFDR.java
    -------------------------------------------------------------------------------------
    package SCJP;
    import java.lang.*;
    public class SFDR 
    {
    public static void main(String[] args)
    {
    System.out.println("this is a class following java code conventions");
    }
    }
    --------------------------------------------------------------------------------------


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: What's the damn error in this program...

    What error are you receiving? Compile time? Run time? Please post the full message. You must take into consideration the package when dealing with the program from the command line (a guess based upon the info you provided), typically involves setting the directory to the parent relative to the package and working from there.
    Last edited by copeg; September 11th, 2010 at 09:55 PM.

  3. #3
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: What's the damn error in this program...

    Well, since this is an exercise in following code conventions, you can find the official version here:
    Code Conventions for the Java(TM) Programming Language: Contents

    I see three deviations:
    Uppercase package name (should be lowercase)
    Unnecessary import of java.lang (imported by default)
    Class name in all uppercase (should be first letter uppercase -- all upppercase is used for constants aka static final variables)

    And of course the lack of any indenting, possibly arising out of your not using code tags.

    db

Similar Threads

  1. How to make an error message when my program crashes?
    By noFear in forum Java Theory & Questions
    Replies: 10
    Last Post: August 11th, 2010, 08:50 AM
  2. Error in Program for Game of Craps
    By TheAsianMenace in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 23rd, 2010, 04:31 AM
  3. Need help with program please: getting symbol error
    By blinkzz in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: November 18th, 2009, 02:23 AM
  4. Error of data types and type casting in java program
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: September 2nd, 2009, 10:22 AM
  5. Error while creating Gym member database through Java programming
    By parvez07 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: August 26th, 2009, 02:17 AM