Java program to demonstrate how to write comments

In this Java program we are going to see how to write comments in java.
In java there are 3 types of comments:-
1>Documentation purpose comments
2>Multi Line comments
3> Single Line comments

//use of comments
class Comment{
public static void main(String args[]){
/**
This comment is used for documentation purpose
*/
System.out.println("This program displays how to write comment");
/*This is a 
Multi-Line 
comment*/
} //This is example of single line comment
}


No comments:

Post a Comment