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 2 of 2

Thread: How do you feel about my javadoc comments?

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    22
    Thanks
    5
    Thanked 1 Time in 1 Post

    Default How do you feel about my javadoc comments?

    Is there anything I'm missing, or anything I should add? Do I need to comment non public/private variables, such as the instance of random called, or my main method variables? My teacher is super anal, and explained javadoc for less than 5 seconds. Surely appreciate it.

    package gps;
    import java.util.Random;
     
    /**
     * @author Jimbob
     * @version 1.0
     */
    public class GPS
    {
        /**
         * The name assigned to construct
         */
        private String name;
        /**
         *  Two part double value assigned to construct
         */
        private GpsCoordinates position;
        Random v1 = new Random();
     
        /**
         * Constructs a GPS from a GpsCoordinate and a string value.
         * @param n String name of GPS
         * @param pos the (x,y) value of GPS
         */
        public GPS ( String n, GpsCoordinates pos )
        {
            name = n;
            position = pos;
        }
        /*
         * Adds a random value between -2.5 and 2.5 to position
         */
        public void updatePosition()
        {
            position.setLatitude( position.getLatitude() - 2.5 + v1.nextInt(6) );
            position.setLongitude( position.getLongitude() - 2.5 + v1.nextInt(6) );
        }
     
        @Override
        /*
         * Converts GPS n to a string value
         * @return string value of GPS n 
         */
        public String toString()
        {
            return String.format( "%s: %s", name, position );
        }
    }
     
    package gps;
     
    /**
     * @author Jimbob
     * @version 1.0
     */
    public class GpsApp
    {
        public static void main( String[] args )
        {
            GpsCoordinates saltLakeCity = new GpsCoordinates( 40.760671, -111.891122 );
            System.out.printf( "Gps coordinates of SLC: %s%n%n", saltLakeCity );
            GPS SLC = new GPS( "Garmin", saltLakeCity );
            System.out.printf( "myGps: %s%n%n", SLC );
            SLC.updatePosition();
            System.out.printf( "position update1:  %s%n", saltLakeCity );
            SLC.updatePosition();
            System.out.printf( "position update2:  %s%n", saltLakeCity );
            SLC.updatePosition();
            System.out.printf( "position update3:  %s%n", saltLakeCity );
        }
    }


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: How do you feel about my javadoc comments?

    Double post closing. Reply at http://www.javaprogrammingforums.com...questions.html

Similar Threads

  1. need help finding code in javadoc
    By lf2killer in forum Java Theory & Questions
    Replies: 3
    Last Post: October 13th, 2012, 08:52 AM
  2. How to generate javadoc from XXXsource.zip
    By JavaCup in forum Java Theory & Questions
    Replies: 2
    Last Post: May 4th, 2012, 01:29 AM
  3. Creating a javadoc help please.
    By jerryg in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 8th, 2012, 10:10 AM
  4. Double always == 0! And a Javadoc issue! (Using NetBeans)
    By CameronFaust in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 11th, 2011, 12:22 AM
  5. How do you generate javadoc?
    By javapenguin in forum Java IDEs
    Replies: 15
    Last Post: November 27th, 2010, 09:12 PM