In this example we will show you how to use single-line comment at the end of a line of code in Java.
Source Code
package com.beginner.examples;
public class LineComment {
public static void main(String[] args) {
System.out.println("OK"); // single-line comment
}
}
Output:
OK