Single and Multi Line Comments in Java
The comments are the statements that are not executed by the compiler and interpreter. It can be used to provide information or explanation about the variable, method, class or any statement. It can also be used to hide program code for a specific time.
- Single Line comments are started by // and may be positioned after a statement on the same line, but not before.
- Multi-Line comments are defined between /* and */. They can span multiple lines and may even been positioned between statements.
Code Snippet
// Single and Multi Line Comments in Java
public class App {
public static void main(String[] args) {
System.out.println("Welcome To Tutor Joes");
/*
* In publishing and graphic design, Lorem ipsum is a placeholder text commonly
* used to demonstrate the visual form of a document or a typeface without
* relying on meaningful content. Lorem ipsum may be used as a placeholder
* before final copy is available.
*/
}
}