How to Implement Multi-line Comment in Java


In this example we will show you how to implement multi-line comment in Java.

Source Code

package com.beginner.examples;

public class MultilineComment {
  public static void main(String[] args) {
    /* Comment line 1
    Comment line 2 */
    System.out.println("Hello World!");
  }
}

Output:

Hello World!
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments