Java document
•
Java
I can't create a document for this code. I think the coomad of my Javadoc is wrong. I read it, but I don't understand. Anyone can correct it through 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
Solution
In your case, you may want to provide a file name instead of a package name
javadoc abc.java
The passive file error message will then disappear No public classes error message still exists – add public. Classes before your class declaration Alternatively, you can pass the - package or - Private flag to Javadoc to contain non - public classes
Then move the document comment directly before the declaration you want to comment on:
/**
* class documentation here
*/
public class abc
{
/**
* method documentation here
*/
public static void main(String a[])
{
/**
* this will be ignored.
*/
System.out.println("documentation");
}
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码
