
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java comments.
Java supports single-line and multi-line comments very similar to C and C++. All characters available inside any comment are ignored by Java compiler.
Example
public class MyFirstJavaProgram { /* This is my first java program. * This will print 'Hello World' as the output * This is an example of multi-line comments. */ public static void main(String []args) { // This is an example of single line comment /* This is also an example of single line comment. */ System.out.println("Hello World"); } }
Output
Hello World
- Related Questions & Answers
- Java documentation comments
- Comments in Java
- /** and /* in Java comments
- Types of Java comments.
- Java single line comments.
- Java multi-line comments
- Executable Comments in Java
- Best practices for Java comments.
- What are comments in Java language?
- HTML Comments
- CSS Comments
- Pattern COMMENTS field in Java with examples
- Comments in C#
- Comments in Perl
- Comments in Python
Advertisements