New to Javadoc

I have gone through the tutorial and am a bit confused on how to comment my program. I can comment my main method but am not sure what to do to comment the other mehods and my variables. Can anyone help me?

import java.util.StringTokenizer;

import java.util.regex.Matcher;

/**

*

* StringQuiz executes the 6 methods assigned in the document using methods

* that are related to strings.

*

* @author Daniel Wood

* Date 2006.02.17

* @version 1.0.0.x

*

*/

publicclass StringQuiz

{

/**

* @param args String array of command line parameters passed to main

*/

publicstaticvoid main(String args[])

{

/**

* @return method_1 uses a regular expression to determine if the 5 address return the boolean

* value of true or false.

*/

method_1();

method_2();

method_3();

method_4();

method_5();

method_6();

}//end main

staticvoid method_1()

{

System.out.println("Method 1");

String address1 ="112 Elm Street";

String address2 ="112 South Elm St.";

String address3 ="112 S. Elm";

String address4 ="Elm St.";

String address5 ="South 112 Elm";

//"[\\d]+[\\s]+[a-zA-Z]+[ .]+[a-zA-z]+[ .]*[a-zA-z]*[ .\\n]?"

String matchString ="\\d+ [A-Z,a-z,. ]+";

System.out.println(address1.matches(matchString));

System.out.println(address2.matches(matchString));

System.out.println(address3.matches(matchString));

System.out.println(address4.matches(matchString));

System.out.println(address5.matches(matchString));

}//end method 1

staticvoid method_2()

{

System.out.println("Method 2");

String csv = ("23, 14, 19,21,3");

StringTokenizer tokens =new StringTokenizer(csv,", ");

while (tokens.hasMoreTokens() ){

System.out.println (tokens.nextToken());

}// end while

}//end method_2

staticvoid method_3()

{

System.out.println("Method 3");

String hello ="Hello, How are you";

hello = hello.replaceAll("H","h");

hello = hello.replaceAll(",",".");

System.out.println(hello);

}// end method_3

staticvoid method_4()

{

System.out.println("Method 4");

String whale ="Willy the whale.";

StringBuffer buffer =new StringBuffer();

buffer.append(whale);

buffer.insert (4,"fff");

System.out.println (buffer.toString());

}// end method_4

staticvoid method_5()

{

System.out.println("Method 5");

String num ="3.456";

float number2 = Float.valueOf(num).floatValue();

System.out.println(number2);

System.out.println(number2 + 10);

}// end method_5

staticvoid method_6()

{

System.out.println("Method 6");

String record ="This is record: 7Pq8";

System.out.println(record.substring(16, 20));

}// end method_6

}// end public class StringQuiz

[5281 byte] By [Dwooda] at [2007-10-2 13:24:26]
# 1

Here is a simple example of how a method is documented. (This is a stupid method, but hopefully you get the idea.)

[code]

/**

* Prints a String. The length of the String is returned.

* @param toPrint the String to be printed

* @returnthe length of the String

* @throws NullPointerException if the String is null

*/

public int printAString(String toPrint) {

if (toPrint == null)

throw new NullPointerException("Null string");

System.out.println(toPrint);

return toPrint.length();

}

Alethiographera at 2007-7-13 11:03:06 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...