+ 5
Java /**....*/
what is /** writing here*/ used for in java? i didnt understand it
15 odpowiedzi
+ 8
A docblock is a /** */ comment, that's just what they are called. For example the link I posted; the source code probably looked something like
/**
* an ordered collection (also known as
* blah blah blah)
*
* @author John Doe
*/
public class List<E> implements Collection<E>, ... {
/**
* Appends the specified element
* blah blah blah
*
* @param e element to be appended
* @return boolean
*/
public boolean add(E e) {
...
}
}
And then javadoc created that website by reading all the docblocks (The link I gave obviously has many more methods than just add). It's nice because you have code and documentation in one place.
+ 22
For multi line comments
+ 5
For multi line comment you use /*... */
/**.... */ is used for something else
+ 4
You use /** */ for docblock comments. That means you use them to describe functions or classes (in an exact format) and then there are tools like javadoc that look for /** */ in your code and generate a nice website for you, that look like this one:
https://docs.oracle.com/javase/7/docs/api/java/util/List.html
That's useful especially for other people who have to use your code, but also for yourself of course.
+ 3
Comments in /**...*/ are used for javadoc. It is a tool for generating API documentation in HTML format. You can document packages, classes, fields, methods, constructors, etc. Nice tool, because it defines a common way for developers to communicate about their code.
+ 2
So you write your comment and then it generates a link for you to find what exactly it means? What are dockblocks?
+ 2
I see thanks
+ 2
/** */ is a java doc comments. JAVADOC comments are like to display the description of a variable or method or class when mouse over on it when it is using some other area. We can identify this feature when we are developing code in eclipse IDE.
+ 2
its nothing
+ 2
its a comment
+ 2
its for programmer
+ 2
nah its not multiline comment, its doc or documents comments (multiline C are being written in /*_______ */ in these
+ 1
It is a multi line comment.
0
Comments not write compiler
0
It's standard to be used in documentation for java.