- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to write multi-line comment in Java?
Multi line comments in Java start with /* and end with */. You can comment multiple lines just by placing them between /* and */.
/* Hello this is the way to write multi line comments in Java */
Example
Following example demonstrates the usage of multiline comments in Java.
public class CommentsExample { /* Following is the main method here, We create a variable named num. And, print its value * */ public static void main(String args[]) { int num = 1; System.out.println("value if the variable num: "+num); } }
Output
value if the variable num: 1
- Related Articles
- How to write single line comment in Java?
- How to write a Multiple-Line Comment in Swift?
- How to comment each condition in a multi-line if statement in Python?
- How to write multi-line comments in C#?
- How do we write Multi-Line Statements in Python?
- Java multi-line comments
- How to write comment based Help in PowerShell?
- How to write a comment in a JSP page?
- How to execute Python multi-line statements in the one-line at command-line?
- How to create a long multi-line string in Python?
- Multi-Line Statements in Python
- Multi-Line printing in Python
- How to write long strings in Multi-lines C/C++?
- How do we use multi-line comments in JavaScript?
- How to put multi-line comments inside a Python dict()?

Advertisements