i am not able to create documentation for this code,i think my coomad of javadoc is not right, i read about it but don't understand ,can anybody correct by javadoc cammand
class abc
{/** documentaion line 1
*
* */
public static void main(String a[])
{/** documentaion line 2
*
* */
System.out.println("documentation");
}
}
Error: C:\Program Files\Java\jdk1.6.0\bin>javac abc.java C:\Program Files\Java\jdk1.6.0\bin>java abc documentation C:\Program Files\Java\jdk1.6.0\bin>javadoc abc Loading source files for package abc... javadoc: warning - No source files for package abc Constructing Javadoc information... javadoc: warning - No source files for package abc javadoc: error - No public or protected classes found to document. 1 error 2 warnings
Fortunately, all modern versions of the JDK provide the Javadoc tool – for generating API documentation from comments present in the source code.
Select the desired package, class or method name, right-click and select Show Javadoc. This will launch your default web browser and navigate to the Javadoc for the selected item.
Whether you are working on a new cutting edge app or simply ramping up on new technology, Java documentation has all the information you need to make your project a smashing success.
What Does Javadoc Mean? Javadoc is a documentation tool for the Java programming language. The document it creates from the Java sources is in HTML format and describes the application programming interface.
In your case, you would want to provide the file name instead of a package name.
javadoc abc.java
Then the no source files error message will disappear.
The no public classes error message will still be there - add public
before your class declaration. Alternatively, you can pass the -package
or -private
flag to Javadoc to include non-public classes too.
Then move the documentation comments directly before the declarations you want to comment:
/**
* class documentation here
*/
public class abc
{
/**
* method documentation here
*/
public static void main(String a[])
{
/**
* this will be ignored.
*/
System.out.println("documentation");
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With