answersLogoWhite

0


Best Answer

// The first type of comment is the single-line comment. // The single-line comment is denoted by a double slash. /* The next type of comment begins with a slash-asterisk, and ends with an asterisk-slash. It is often called a multi-line comment because it can span multiple lines with only one start indicator (/*) and one ending indicator (*/) */ /** * The last type of comment is the Javadoc comment. This * comment type has some guidelines that allows a Javadoc * reader to display information about a Java method or class * by using special tags: * * @param myNum - describe what the parameter myNum is used for * @return - describe what this method returns */ public static int doStuff(int myNum){}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

In Java a single line comment begins with two forward slashes and continues until the end of the line. For example:

// this is a comment

or

a = b + c; // comment doesn't have to take up the whole line

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

Java has three types of comments that I know of...

Single line comments beginning with a double forward oblique stroke:

// This is a single line comment

// here's another

There's also multi-line comments:

/* This comment could

** traverse

** many lines. It starts with a forward oblique stroke,

** is followed by an asterisk and doesn't stop until an asterisk

** is followed by a terminating forward oblique stroke. The two

** asterisks at the front of each of these lines is not a rule, just tidy */

If you use a double asterisk at the beginning of a multi-line comment, the code can be parsed by a document creator - JavaDocs. There's special tags that can be used, like "author" and "version":

/**

* Some JavaDocs

*

* @author ph73nt

* @version 1.0

*

*/

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Comments are statements in a Java class that are not read or interpreted by the Java compiler. These are present for the purpose of adding more meaning to the code and provide understanding to the developers. There are two types of comments:

// This is a single line comment

/*

This is a

Multi line comment

*/

/** This is an documentation

comment */

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Two types of comments are supported by Java.

Single line comments - Any line which begins with two forward slashes is a single line comment

Ex:

//This line is a comment.

Multi line comment - The lines enclosed by a /* and */ are multi line comments

Ex:

/* This is a

multi line

Comment */

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

With a double slash, //, the compiler will ignore any further text until the end of the line.

A multiline comment starts with /* and ends with */.

A comment that starts with /** and ends with */will also be ignored by the compiler, however, it includes special instructions for a documenting utility.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

There are three possibilities to add a comment to Java:

// One Line Comment

/* Multiple

Line

Comment */

/** Documentation comment*/

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Comments are non executable statements written for the better understanding of fresh learner of java

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Any line of code that ends with a semi colon (;) can be termed as one line.

ex: int x = 10;

System.out.println("Hello World");

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Explain different types of comment line in JAVA?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the different types of language?

c, c++, java


What are the different types in java programming language?

core java ,jse.advanced jse,jee and j2me


What are the eight java operator?

The different types of operators in Java are:Assignment OperatorsRelational OperatorsArithmetic OperatorsLogical Operators


Explain three different methods in java?

There are three different methods /functions in java are there : 1)computational methods.2)manipulative methods.3)procedural methods.


3rd sem model question papers from vtu?

(Affiliated to Osmania University) Khairatabad, Hyderabad First Term Examination B.Sc. 3 Year Web Technologies(c4) Time: 3 Hours Max. Marks: 100 SECTION-A Note: Answer any FIVE questions 5*8=40 1. Explain Text formatting tags of HTML. 2. Write a note on XML. 3. What is Form? Give a suitable example. 4. What is hyperlink? Explain with example. 5. Write about html tags for defining lists. 6. Explain cascade style sheets. 7. Write a note on Frames. 8. How to define tables using HTML tags. 9. Write a note on Java Script Variables. 10. Explain Extensible HTML? SECTION-B Answer any FIVE questions. 5*12=60 1. Explain how to add images and colors into a web page. 2. Discuss in detail Data types used in Java Script. 3. Explain different types of operators used in Java Script. 4. Explain different types of lists. 5. Explain Objects in Java Script. 6. Discuss in detail Events in Java Script. 7. What is String Manipulation in Java Script. 8. Write a HTML code for image as Hyperlink. 9. Write about Active Server Pages. 10. Explain different types of statements in Java Script.


How java is different from c plus plus Explain with example?

See related links, below.


What are the different types of relationships in java?

Following are the types: 1)Is a 2)Has a 3)Uses a 4)Own zip


What is JButton in java and explain it?

A JButton on Java is a button used for G.U.I (graphical user interface) and displays a button on a window created which can be programmed for different tasks.


What happens when you perform arithmetic operations mixing different types of variables in java programming?

Java performs an implicit conversion to a unifying type.


Describe different types of java tools?

javac,rmic,eclipse,jbuilder etc..,


What does poi comment mean in English?

Poi Comment is part of Java's Excel sheet coding. It has no other meaning.


Explain the role of sizeof operator in java?

There is no sizeOf() operator in Java.