Can someone give me direct and simple anwers to the following Java questions? (1
ID: 641534 • Letter: C
Question
Can someone give me direct and simple anwers to the following Java questions?
(1) How do you identify comment so the Javadoc tool will recognize it?
(2)) What should a comment at the class level contain?
(3) What is a tag and how are they used in Javadoc comments ? Give an example of using tags in your answer.
(4) What type of information should be included in a method level comments?
(5) How do you provide a link from one class to a related class?
(6) What type of output does the Javadoc command generate and how do you view the output?
Explanation / Answer
1)
by just identifying strings /*....*/
even java docs or any one identifies by parsing these characters
2) class name and what this program is for
3)
Javadoc tags are keywords recognized by Javadoc which define the type of information that follows
import java.io.*;
public class AddNum {
/**
* This method is used to add two integers. This is
* a the simplest form of a class method, just to
* show the usage of various javadoc Tags.
* @param numA This is the first paramter to addNum method
* @param numB This is the second parameter to addNum method
* @return int This returns sum of numA and numB.
*/
public int addNum(int numA, int numB) {
return numA + numB;
}
/**
* This is the main method which makes use of addNum method.
* @param args Unused.
* @return Nothing.
* @exception IOException On input error.
* @see IOException
*/
public static void main(String args[]) throws IOException
{
AddNum obj = new AddNum();
int sum = obj.addNum(10, 20);
System.out.println("Sum of 10 and 20 is :" + sum);
}
}
4)
functionality of methods and mention if any function calls are there
5)To create a link to a specific class you can use the {@link mypackage.AbstractVehicle} tag. Likewise, you can use {@link mypackage.AbstractVehicle#someMethod} to create a link to someMethod() in the AbstractVehicle class.