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 */


Following example demonstrates the usage of multiline comments in Java.

Live Demo

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);


value if the variable num: 1